mirror of https://github.com/nodejs/node.git
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: https://github.com/nodejs/io.js/pull/1661 Reviewed-By: Fedor Indutny <fedor@indutny.com>pull/1661/merge
parent
d4726cde57
commit
e008e8faba
|
@ -362,7 +362,7 @@ TLSSocket.prototype._init = function(socket, wrap) {
|
|||
self._writableState.errorEmitted = true;
|
||||
|
||||
// Destroy socket if error happened before handshake's finish
|
||||
if (!this._secureEstablished) {
|
||||
if (!self._secureEstablished) {
|
||||
self._tlsError(err);
|
||||
self.destroy();
|
||||
} else if (options.isServer &&
|
||||
|
|
Loading…
Reference in New Issue