summaryrefslogtreecommitdiff
path: root/lib/_tls_wrap.js
diff options
context:
space:
mode:
authorShigeki Ohtsu <ohtsu@iij.ad.jp>2015-05-08 13:30:50 +0900
committerFedor Indutny <fedor@indutny.com>2015-05-16 12:33:46 +0200
commite008e8faba34d6e5bd760e68cdff1f3fe0e04514 (patch)
treefe614caf0f7dcd1895d512967eaaef4f248ae99d /lib/_tls_wrap.js
parentd4726cde57856896c560820b89eae0bc08621034 (diff)
downloadnode-new-e008e8faba34d6e5bd760e68cdff1f3fe0e04514.tar.gz
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>
Diffstat (limited to 'lib/_tls_wrap.js')
-rw-r--r--lib/_tls_wrap.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js
index 0a30cd3310..5a35c3bd96 100644
--- a/lib/_tls_wrap.js
+++ b/lib/_tls_wrap.js
@@ -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 &&