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 <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Daniel Bevenius
2019-06-05 09:44:46 +02:00
parent 03d008fe28
commit 5bad51406d

View File

@@ -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');
}