Browse Source

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: https://github.com/nodejs/node/pull/4624
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v5.x
Fedor Indutny 9 years ago
committed by Myles Borins
parent
commit
b70eec8f7b
  1. 2
      lib/_tls_legacy.js

2
lib/_tls_legacy.js

@ -614,6 +614,7 @@ function onclienthello(hello) {
if (err) return self.socket.destroy(err); if (err) return self.socket.destroy(err);
setImmediate(function() {
self.ssl.loadSession(session); self.ssl.loadSession(session);
self.ssl.endParser(); self.ssl.endParser();
@ -621,6 +622,7 @@ function onclienthello(hello) {
self._resumingSession = false; self._resumingSession = false;
self.cleartext.read(0); self.cleartext.read(0);
self.encrypted.read(0); self.encrypted.read(0);
});
} }
if (hello.sessionId.length <= 0 || if (hello.sessionId.length <= 0 ||

Loading…
Cancel
Save