Skip to content

Commit

Permalink
tls: comment about old-style errors
Browse files Browse the repository at this point in the history
Old style errors are being migrated to internal/errors.js, however, due
to depreciation of _tls_legacy.js, it isn't worth the effort to migrate
and potentially force users to update their code for this error change.

This comment clarifies the reason why this error is not migrated.

Refs:nodejs#17709 (comment)
  • Loading branch information
Xavier-J-Ortiz committed Dec 19, 2017
1 parent 97cee72 commit c9fdd56
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/_tls_legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,8 @@ function onhandshakestart() {
// state machine and OpenSSL is not re-entrant. We cannot allow the user's
// callback to destroy the connection right now, it would crash and burn.
setImmediate(function() {
// Old-style error is not being migrated to the newer style
// internal/errors.js because _tls_legacy.js has been depreciated.
var err = new Error('TLS session renegotiation attack detected');
if (self.cleartext) self.cleartext.emit('error', err);
});
Expand Down

0 comments on commit c9fdd56

Please sign in to comment.