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>
This commit is contained in:
Shigeki Ohtsu authored and Fedor Indutny committed 2015-05-16 12:33:46 +02:00
1 parent d4726cde57
commit e008e8faba
1 file changed
+1 -1
+1 -1
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 &&