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.
  • Loading branch information
danbev committed Jun 5, 2019
1 parent 2c76874 commit 1a6efb6
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 1a6efb6

Please sign in to comment.