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
Shigeki Ohtsu 2015-05-08 13:30:50 +09:00 committed by Fedor Indutny
parent d4726cde57
commit e008e8faba
1 changed files with 1 additions and 1 deletions

View File

@ -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 &&