TLS
Node.js tls module — TLS/SSL encrypted networking.
Module:node:tls
Support: Experimental
Since: 1.1.0
Docs: Node.js Docs
Static Methods
Properties
— Array of root CA certificates bundled with Node.js.
— The default ECDH curve name used in TLS (e.g. "auto").
— The default maximum TLS version accepted.
— The default minimum TLS version accepted.
Dictionary TlsConnectOptions
Options for establishing a TLS connection.
Since: 1.1.0 Docs: Node.js Docs11 members: 1 supported, 10 undocumented
Properties
Options for establishing a TLS connection.
Remote hostname (default: "localhost").
If true, rejects unauthorized server certificates (default: true).
Server name for SNI; defaults to host.
List of ALPN protocol names in preference order.
Minimum TLS version to accept (e.g. "TLSv1.2").
Maximum TLS version to accept.
OpenSSL cipher suite string.
Trusted CA certificate(s) (PEM string, Buffer, or array).
Client certificate (PEM string or Buffer).
Client certificate (PEM string or Buffer).
---
Dictionary SecureContextOptions
Options for creating a TLS secure context.
Since: 1.1.0 Docs: Node.js Docs9 members: 9 undocumented
Properties
Trusted CA certificate(s) (PEM string, Buffer, or array).
Client certificate (PEM string or Buffer).
Client certificate (PEM string or Buffer).
OpenSSL cipher suite string.
If true, prefer the server's cipher order over the client's.
Minimum TLS version to accept (e.g. "TLSv1.2").
Maximum TLS version to accept.
Passphrase to decrypt the private key.
PFX/PKCS#12 encoded private key and certificate chain.
---
Interface TLSSocket
A TLS-encrypted Socket wrapping a net.Socket.
Extends: Socket Implements: EventEmitter Since: 1.1.0 Docs: Node.js Docs11 members: 10 supported, 1 undocumented
Methods
Properties
— True if the peer certificate was signed by a trusted CA.
— Authorization error if authorized is false, otherwise null.
— Always true — confirms that the socket uses TLS encryption.
— The negotiated ALPN protocol, or null/false if none.
Server name for SNI; defaults to host.
---
Details
renegotiate(options, callback)
renegotiate(options: object, callback: object)
renegotiate(options: object, callback: object)
Initiates a TLS renegotiation.| Parameter | Type | Description |
|---|---|---|
options | object | Renegotiation options (e.g. rejectUnauthorized, requestCert) |
callback | object | Called with (err) when renegotiation completes |
---