An array of strings or a Buffer naming possible ALPN protocols. (Protocols should be ordered by their priority.) When the server receives both NPN and ALPN extensions from the client, ALPN takes precedence over NPN and the server does not send an NPN extension to the client.
An array of strings or a Buffer naming possible NPN protocols. (Protocols should be ordered by their priority.)
SNICallback(servername, cb)
If true the TLS socket will be instantiated in server-mode. Defaults to false.
If true the server will reject any connection which is not authorized with the list of supplied CAs. This option only has an effect if requestCert is true. Defaults to false.
If true the server will request a certificate from clients that connect and attempt to verify that certificate. Defaults to false.
If true, specifies that the OCSP status request extension will be added to the client hello and an 'OCSPResponse' event will be emitted on the socket before establishing a secure communication
An optional TLS context object from tls.createSecureContext()
An optional net.Server instance.
An optional Buffer instance containing a TLS session.
The reason why the peer's certificate has not been verified. This property becomes available only when tlsSocket.authorized === false.
A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false.
Static boolean value, always true. May be used to distinguish TLS sockets from regular ones.
The string representation of the local IP address.
The numeric representation of the local port.
The string representation of the remote IP address. For example, '74.125.127.100' or '2001:4860:a005::68'.
The string representation of the remote IP family. 'IPv4' or 'IPv6'.
The numeric representation of the remote port. For example, 443.
events.EventEmitter
Returns the bound address, the address family name and port of the underlying socket as reported by the operating system.
Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection.
Returns an object representing the peer's certificate. The returned object has some properties corresponding to the field of the certificate. If detailed argument is true the full chain with issuer property will be returned, if false only the top certificate without issuer property. If the peer does not provide a certificate, it returns null or an empty object.
If true; the full chain with issuer property will be returned.
Could be used to speed up handshake establishment when reconnecting to the server.
NOTE: Works only with client TLS sockets. Useful only for debugging, for session reuse provide session option to tls.connect().
Initiate TLS renegotiation process.
NOTE: Can be used to request peer's certificate after the secure connection has been established. ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout.
The options may contain the following fields: rejectUnauthorized, requestCert (See tls.createServer() for details).
callback(err) will be executed with null as err, once the renegotiation is successfully completed.
Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512). Smaller fragment size decreases buffering latency on the client: large fragments are buffered by the TLS layer until the entire fragment is received and its integrity is verified; large fragments can span multiple roundtrips, and their processing can be delayed due to packet loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead, which may decrease overall server throughput.
TLS fragment size (default and maximum value is: 16384, minimum is: 512).
Generated using TypeDoc
Construct a new tls.TLSSocket object from an existing TCP socket.