tls.TLSSocket

Class: tls.TLSSocket This is a wrapped version of net.Socket that does transparent encryption of written data and all required TLS negotiation. This instance implements the duplex Stream interface. It has all the common stream methods and events. Methods that return TLS connection metadata (e.g. tls.TLSSocket.getPeerCertificate() will only return data while the connection is open.

tls.getCiphers()

tls.getCiphers() Returns an array with the names of the supported SSL ciphers. Example: var ciphers = tls.getCiphers(); console.log(ciphers); // ['AES128-SHA', 'AES256-SHA', ...]

tls.Server

Class: tls.Server This class is a subclass of net.Server and has the same methods on it. Instead of accepting only raw TCP connections, this accepts encrypted connections using TLS or SSL.

tls.createServer()

tls.createServer(options[, secureConnectionListener]) Creates a new tls.Server. The connectionListener argument is automatically set as a listener for the 'secureConnection' event. The options object may contain the following fields: pfx: A string or Buffer containing the private key, certificate and CA certs of the server in PFX or PKCS12 format. (Mutually exclusive with the key, cert, and ca options.) key: A string or Buffer containing the private key of the server in PEM format. To suppo

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( ... ). isSer

tls.createSecureContext()

tls.createSecureContext(options) Creates a credentials object; the options object may contain the following fields: pfx : A string or Buffer holding the PFX or PKCS12 encoded private key, certificate, and CA certificates. key: A string or Buffer containing the private key of the server in PEM format. To support multiple keys using different algorithms, an array can be provided. It can either be a plain array of keys or an array of objects in the format {pem: key, passphrase: passphrase}. (Re

tls.connect()

tls.connect(options[, callback])

stringdecoder.end()

decoder.end() Returns any trailing bytes that were left in the buffer.

timeout event (net.Socket)

Event: 'timeout' Emitted if the socket times out from inactivity. This is only to notify that the socket has been idle. The user must manually close the connection. See also: socket.setTimeout()

SyntaxError

Class: SyntaxError A subclass of Error that indicates that a program is not valid JavaScript. These errors may only be generated and propagated as a result of code evaluation. Code evaluation may happen as a result of eval, Function, require, or vm. These errors are almost always indicative of a broken program. try { require('vm').runInThisContext('binary ! isNotOk'); } catch(err) { // err will be a SyntaxError } SyntaxError instances are unrecoverable in the context that created them – th