@@ -455,7 +455,10 @@ changes:
455
455
description: ALPN options are supported now.
456
456
-->
457
457
458
- * ` socket ` {net.Socket} An instance of [ ` net.Socket ` ] [ ]
458
+ * ` socket ` {net.Socket|stream.Duplex}
459
+ On the server side, any ` Duplex ` stream. On the client side, any
460
+ instance of [ ` net.Socket ` ] [ ] (for generic ` Duplex ` stream support
461
+ on the client side, [ ` tls.connect() ` ] [ ] must be used).
459
462
* ` options ` {Object}
460
463
* ` isServer ` : The SSL/TLS protocol is asymmetrical, TLSSockets must know if
461
464
they are to behave as a server or a client. If ` true ` the TLS socket will be
@@ -815,10 +818,12 @@ changes:
815
818
* ` port ` {number} Port the client should connect to.
816
819
* ` path ` {string} Creates unix socket connection to path. If this option is
817
820
specified, ` host ` and ` port ` are ignored.
818
- * ` socket ` {net.Socket} Establish secure connection on a given socket rather
819
- than creating a new socket. If this option is specified, ` path ` , ` host ` and
820
- ` port ` are ignored. Usually, a socket is already connected when passed to
821
- ` tls.connect() ` , but it can be connected later. Note that
821
+ * ` socket ` {stream.Duplex} Establish secure connection on a given socket
822
+ rather than creating a new socket. Typically, this is an instance of
823
+ [ ` net.Socket ` ] [ ] , but any ` Duplex ` stream is allowed.
824
+ If this option is specified, ` path ` , ` host ` and ` port ` are ignored,
825
+ except for certificate validation. Usually, a socket is already connected
826
+ when passed to ` tls.connect() ` , but it can be connected later. Note that
822
827
connection/disconnection/destruction of ` socket ` is the user's
823
828
responsibility, calling ` tls.connect() ` will not cause ` net.connect() ` to be
824
829
called.
0 commit comments