From 7c158bf365651b67aec3c5be58cc00ce53f24af6 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. --- 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 12edef98481995..4f0ba8daa99360 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -1023,6 +1023,9 @@ being issued by trusted CA (`options.ca`).