镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Commit 7821b3e

Browse files
indutnyMyles Borins
authored andcommitted
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 <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent d71f999 commit 7821b3e

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

‎lib/_tls_legacy.js‎

Lines changed: 8 additions & 6 deletions
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)