Skip to content

Commit e008e8f

Browse files
Shigeki Ohtsuindutny
Shigeki Ohtsu
authored andcommitted
tls: fix tls handshake check in ssl error
In ssl.onerror event, `this` refers `ssl` so that `this._secureEstablished` is always undefined. Fix it to refer TLSSocket. PR-URL: #1661 Reviewed-By: Fedor Indutny <[email protected]>
1 parent d4726cd commit e008e8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/_tls_wrap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ TLSSocket.prototype._init = function(socket, wrap) {
362362
self._writableState.errorEmitted = true;
363363

364364
// Destroy socket if error happened before handshake's finish
365-
if (!this._secureEstablished) {
365+
if (!self._secureEstablished) {
366366
self._tlsError(err);
367367
self.destroy();
368368
} else if (options.isServer &&

0 commit comments

Comments
 (0)