tls.createSecurePair()

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 from tls.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 with requestCert enabled.

  • options: An object with common SSL options. See tls.TLSSocket.

tls.createSecurePair() returns a SecurePair object with cleartext and encrypted stream properties.

NOTE: cleartext has the same API as tls.TLSSocket

doc_Nodejs
2016-04-30 04:42:36
Comments
Leave a Comment

Please login to continue.