diff options
author | Luigi Pinca <luigipinca@gmail.com> | 2019-01-15 16:12:12 +0100 |
---|---|---|
committer | Luigi Pinca <luigipinca@gmail.com> | 2019-01-20 14:56:35 +0100 |
commit | aaa7547e7779520428a2e48b728a5993b00c330a (patch) | |
tree | 24015b90d6f21eb67eff9c7952022c79c3878c17 /doc | |
parent | cc26957cc30d89619d3b9be85f5301111e17615a (diff) | |
download | android-node-v8-aaa7547e7779520428a2e48b728a5993b00c330a.tar.gz android-node-v8-aaa7547e7779520428a2e48b728a5993b00c330a.tar.bz2 android-node-v8-aaa7547e7779520428a2e48b728a5993b00c330a.zip |
tls: make tls.connect() accept a timeout option
If specified, and only when a socket is created internally, the option
will make `socket.setTimeout()` to be called on the created socket with
the given timeout.
This is consistent with the `timeout` option of `net.connect()` and
prevents the `timeout` option of the `https.Agent` from being ignored
when a socket is created.
PR-URL: https://github.com/nodejs/node/pull/25517
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/tls.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/api/tls.md b/doc/api/tls.md index 75dc1bf27f..bfa06925ef 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -1023,6 +1023,9 @@ being issued by trusted CA (`options.ca`). <!-- YAML added: v0.11.3 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/25517 + description: The `timeout` option is supported now. - version: v8.0.0 pr-url: https://github.com/nodejs/node/pull/12839 description: The `lookup` option is supported now. @@ -1088,6 +1091,9 @@ changes: `tls.createSecureContext()`. * `lookup`: {Function} Custom lookup function. **Default:** [`dns.lookup()`][]. + * `timeout`: {number} If set and if a socket is created internally, will call + [`socket.setTimeout(timeout)`][] after the socket is created, but before it + starts the connection. * ...: [`tls.createSecureContext()`][] options that are used if the `secureContext` option is missing, otherwise they are ignored. * `callback` {Function} @@ -1549,6 +1555,7 @@ where `secureSocket` has the same API as `pair.cleartext`. [`server.getTicketKeys()`]: #tls_server_getticketkeys [`server.listen()`]: net.html#net_server_listen [`server.setTicketKeys()`]: #tls_server_setticketkeys_keys +[`socket.setTimeout(timeout)`]: #net_socket_settimeout_timeout_callback [`tls.DEFAULT_ECDH_CURVE`]: #tls_tls_default_ecdh_curve [`tls.Server`]: #tls_class_tls_server [`tls.TLSSocket.getPeerCertificate()`]: #tls_tlssocket_getpeercertificate_detailed |