String containing the selected ALPN protocol. When ALPN has no selected protocol, tlsSocket.alpnProtocol equals false.
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.
When enabled, TLS packet trace information is written to stderr
. This can be
used to debug TLS connection problems.
Note: The format of the output is identical to the output of openssl s_client
-trace
or openssl s_server -trace
. While it is produced by OpenSSL's
SSL_trace()
function, the format is undocumented, can change without notice,
and should not be relied on.
Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection.
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.
An object representing the peer's certificate.
Returns a string containing the negotiated SSL/TLS protocol version of the current connection.
The value 'unknown'
will be returned for connected sockets that have not completed the handshaking process.
The value null
will be returned for server sockets or disconnected client sockets.
See https://www.openssl.org/docs/man1.0.2/ssl/SSL_get_version.html for more information.
negotiated SSL/TLS protocol version of the current connection
Could be used to speed up handshake establishment when reconnecting to the server.
ASN.1 encoded TLS session or undefined if none was negotiated.
NOTE: Works only with client TLS sockets. Useful only for debugging, for session reuse provide session option to tls.connect().
TLS session ticket or undefined if none was negotiated.
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.
undefined
when socket is destroy, false
if negotiaion can't be initiated.
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).
Returns true on success, false otherwise.
A utility method for creating Readable Streams out of iterators.
Generated using TypeDoc
Construct a new tls.TLSSocket object from an existing TCP socket.