Skip to content

Commit

Permalink
crypto: add debug info client emit secureConnect
Browse files Browse the repository at this point in the history
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: #28067
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
danbev committed Jun 10, 2019
1 parent 03d008f commit 5bad514
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down

0 comments on commit 5bad514

Please sign in to comment.