tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options])
Creates a new secure pair object with two streams, one of which reads and writes the encrypted data and the other of which reads and writes the cleartext data. Generally, the encrypted stream is piped to/from an incoming encrypted data stream and the cleartext one is used as a replacement for the initial encrypted stream.
-
credentials
: A secure context object fromtls.createSecureContext( ... )
. -
isServer
: A boolean indicating whether this TLS connection should be opened as a server or a client. -
requestCert
: A boolean indicating whether a server should request a certificate from a connecting client. Only applies to server connections. -
rejectUnauthorized
: A boolean indicating whether a server should automatically reject clients with invalid certificates. Only applies to servers withrequestCert
enabled. -
options
: An object with common SSL options. Seetls.TLSSocket
.
tls.createSecurePair()
returns a SecurePair object with cleartext
and encrypted
stream properties.
NOTE: cleartext
has the same API as tls.TLSSocket
Please login to continue.