From 58952a1a9689fff74b7cad561a6f247723326f33 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 c7bd89f50101af..7819475ffeb745 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -1023,6 +1023,9 @@ being issued by trusted CA (`options.ca`).