Skip to content

Commit 7821b3e

Browse files
indutnyMyles Borins
authored and
Myles Borins
committed
tls_legacy: do not read on OpenSSL's stack
Do not attempt to read data from the socket whilst on OpenSSL's stack, weird things may happen, and this is most likely going to result in some kind of error. PR-URL: #4624 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent d71f999 commit 7821b3e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/_tls_legacy.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -614,13 +614,15 @@ function onclienthello(hello) {
614614

615615
if (err) return self.socket.destroy(err);
616616

617-
self.ssl.loadSession(session);
618-
self.ssl.endParser();
617+
setImmediate(function() {
618+
self.ssl.loadSession(session);
619+
self.ssl.endParser();
619620

620-
// Cycle data
621-
self._resumingSession = false;
622-
self.cleartext.read(0);
623-
self.encrypted.read(0);
621+
// Cycle data
622+
self._resumingSession = false;
623+
self.cleartext.read(0);
624+
self.encrypted.read(0);
625+
});
624626
}
625627

626628
if (hello.sessionId.length <= 0 ||

0 commit comments

Comments
 (0)