From 3f1787b47d7eb3f29f06c6ce103c162d2ed151e3 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 5 Jun 2019 09:44:46 +0200 Subject: [PATCH] crypto: add debug info client emit secureConnect Currently, when debugging a TLS connection there might be multiple debug statements 'client emit secureConnect' for the 'secureConnect` event when using NODE_DEBUG='tls'. While it is possible to step through this with a debugger that is not always the fastest/easiest to do if debugging remote code. This commit adds some additional information to the debug statements to make it easier to distinguish where the debug statements are coming from. PR-URL: https://github.com/nodejs/node/pull/28067 Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: Sam Roberts Reviewed-By: Yongsheng Zhang Reviewed-By: Trivikram Kamat Reviewed-By: Rich Trott --- lib/_tls_wrap.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 58ad741cbf2172..d3483fc44a34b2 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -1335,12 +1335,14 @@ function onConnectSecure() { this.destroy(verifyError); return; } else { - debug('client emit secureConnect'); + debug('client emit secureConnect. rejectUnauthorized: %s, ' + + 'authorizationError: %s', options.rejectUnauthorized, + this.authorizationError); this.emit('secureConnect'); } } else { this.authorized = true; - debug('client emit secureConnect'); + debug('client emit secureConnect. authorized:', this.authorized); this.emit('secureConnect'); }