socket
{net.Socket|stream.Duplex} On the server side, anyDuplex
stream. On the client side, any instance of [net.Socket
][] (for genericDuplex
stream support on the client side, [tls.connect()
][] must be used).options
{Object}enableTrace
: See [tls.createServer()
][]isServer
: The SSL/TLS protocol is asymmetrical, TLSSockets must know if they are to behave as a server or a client. Iftrue
the TLS socket will be instantiated as a server. Default:false
.server
{net.Server} A [net.Server
][] instance.requestCert
: Whether to authenticate the remote peer by requesting a certificate. Clients always request a server certificate. Servers (isServer
is true) may setrequestCert
to true to request a client certificate.rejectUnauthorized
: See [tls.createServer()
][]ALPNProtocols
: See [tls.createServer()
][]SNICallback
: See [tls.createServer()
][]session
{Buffer} ABuffer
instance containing a TLS session.requestOCSP
{boolean} Iftrue
, 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 communicationsecureContext
: TLS context object created with [tls.createSecureContext()
][]. If asecureContext
is not provided, one will be created by passing the entireoptions
object totls.createSecureContext()
.- …: [
tls.createSecureContext()
][] options that are used if thesecureContext
option is missing. Otherwise, they are ignored.
Construct a new tls.TLSSocket
object from an existing TCP socket.