Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
indutny committed Jan 11, 2016
commit 13097f14a4aa93213faa35810a349e1de9df5a48
14 changes: 8 additions & 6 deletions lib/_tls_legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,13 +614,15 @@ function onclienthello(hello) {

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

self.ssl.loadSession(session);
self.ssl.endParser();
setImmediate(function() {
self.ssl.loadSession(session);
self.ssl.endParser();

// Cycle data
self._resumingSession = false;
self.cleartext.read(0);
self.encrypted.read(0);
// Cycle data
self._resumingSession = false;
self.cleartext.read(0);
self.encrypted.read(0);
});
}

if (hello.sessionId.length <= 0 ||
Expand Down