From 2319bc55ca350c1f2ebdc715dca64da6ec5c84a9 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Tue, 15 Jan 2019 16:12:12 +0100 Subject: [PATCH] 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 Reviewed-By: Roman Reiss Reviewed-By: Ruben Bridgewater --- doc/api/tls.md | 7 +++++++ lib/_tls_wrap.js | 5 +++++ .../test-tls-connect-timeout-option.js | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 test/parallel/test-tls-connect-timeout-option.js diff --git a/doc/api/tls.md b/doc/api/tls.md index e75dbf43a5c663..fce4f48eb7b46a 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -967,6 +967,9 @@ similar to: