diff --git a/doc/api/tls.md b/doc/api/tls.md index 7df2ab938606..d0027f8d83df 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -1668,6 +1668,27 @@ and their processing can be delayed due to packet loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead, which may decrease overall server throughput. +### `tlsSocket.socket` + + + +* Type: {net.Socket|stream.Duplex|null} + +The underlying socket or stream that this socket reads and writes TLS data +through. This is the `socket` passed to [`new tls.TLSSocket()`][] or +[`tls.connect()`][], or the connection given to a [`tls.Server`][] by its +`'connection'` event. + +This is only `null` for client sockets that manage their own connection, +created by [`tls.connect()`][] with a `port` or `path` rather than a `socket`. +Connection details such as `remoteAddress` are then available directly on this +socket. Server sockets always have an underlying socket. + +This remains available after the socket has been destroyed, for example to +identify the underlying connection from a [`'tlsClientError'`][] listener. + ## `tls.checkServerIdentity(hostname, cert)`