Skip to content

Commit fb40d84

Browse files
committed
doc: fix tls.connect() timeout documentation
1 parent 6c306b6 commit fb40d84

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

doc/api/tls.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,6 +1730,10 @@ changes:
17301730
**Default:** `1024`.
17311731
* `highWaterMark` {number} Consistent with the readable stream `highWaterMark` parameter.
17321732
**Default:** `16 * 1024`.
1733+
* `timeout` {number} Sets the socket to timeout after `timeout` milliseconds
1734+
of inactivity. By default, no timeout is set. This option is supported
1735+
because `tls.connect()` internally uses [`net.createConnection()`][]
1736+
and is equivalent to calling [`socket.setTimeout()`][] on the returned socket.
17331737
* `secureContext`: TLS context object created with
17341738
[`tls.createSecureContext()`][]. If a `secureContext` is _not_ provided, one
17351739
will be created by passing the entire `options` object to
@@ -1740,7 +1744,7 @@ changes:
17401744
`onread` option of [`net.Socket`][] for details.
17411745
* ...: [`tls.createSecureContext()`][] options that are used if the
17421746
`secureContext` option is missing, otherwise they are ignored.
1743-
* ...: Any [`socket.connect()`][] option not already listed.
1747+
* ...: Any [`net.createConnection()`][] option not already listed.
17441748
* `callback` {Function}
17451749
* Returns: {tls.TLSSocket}
17461750

@@ -2478,7 +2482,6 @@ added: v0.11.3
24782482
[`server.getTicketKeys()`]: #servergetticketkeys
24792483
[`server.listen()`]: net.md#serverlisten
24802484
[`server.setTicketKeys()`]: #serversetticketkeyskeys
2481-
[`socket.connect()`]: net.md#socketconnectoptions-connectlistener
24822485
[`tls.DEFAULT_ECDH_CURVE`]: #tlsdefault_ecdh_curve
24832486
[`tls.DEFAULT_MAX_VERSION`]: #tlsdefault_max_version
24842487
[`tls.DEFAULT_MIN_VERSION`]: #tlsdefault_min_version
@@ -2500,4 +2503,6 @@ added: v0.11.3
25002503
[certificate object]: #certificate-object
25012504
[cipher list format]: https://www.openssl.org/docs/man1.1.1/man1/ciphers.html#CIPHER-LIST-FORMAT
25022505
[forward secrecy]: https://en.wikipedia.org/wiki/Perfect_forward_secrecy
2506+
[`net.createConnection()`]: https://nodejs.org/api/net.html#net_net_createconnection_options_callback
2507+
[`socket.setTimeout()`]: https://nodejs.org/api/net.html#socketsettimeouttimeout-callback
25032508
[perfect forward secrecy]: #perfect-forward-secrecy

0 commit comments

Comments
 (0)