parent
39058bef07
commit
4580be0882
10
lib/tls.js
10
lib/tls.js
@ -922,9 +922,13 @@ SecurePair.prototype.error = function(returnOnly) {
|
|||||||
this.ssl.error = null;
|
this.ssl.error = null;
|
||||||
|
|
||||||
if (!this._secureEstablished) {
|
if (!this._secureEstablished) {
|
||||||
if (!err) {
|
// Emit ECONNRESET instead of zero return
|
||||||
err = new Error('socket hang up');
|
if (!err || err.message === 'ZERO_RETURN') {
|
||||||
err.code = 'ECONNRESET';
|
var connReset = new Error('socket hang up');
|
||||||
|
connReset.code = 'ECONNRESET';
|
||||||
|
connReset.sslError = err && err.message;
|
||||||
|
|
||||||
|
err = connReset;
|
||||||
}
|
}
|
||||||
this.destroy();
|
this.destroy();
|
||||||
if (!returnOnly) this.emit('error', err);
|
if (!returnOnly) this.emit('error', err);
|
||||||
|
@ -927,6 +927,11 @@ int Connection::HandleSSLError(const char* func, int rv, ZeroStatus zs) {
|
|||||||
DEBUG_PRINT("[%p] SSL: %s want read\n", ssl_, func);
|
DEBUG_PRINT("[%p] SSL: %s want read\n", ssl_, func);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
} else if (err == SSL_ERROR_ZERO_RETURN) {
|
||||||
|
handle_->Set(String::New("error"),
|
||||||
|
Exception::Error(String::New("ZERO_RETURN")));
|
||||||
|
return rv;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
BUF_MEM* mem;
|
BUF_MEM* mem;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user