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;
|
||||
|
||||
if (!this._secureEstablished) {
|
||||
if (!err) {
|
||||
err = new Error('socket hang up');
|
||||
err.code = 'ECONNRESET';
|
||||
// Emit ECONNRESET instead of zero return
|
||||
if (!err || err.message === 'ZERO_RETURN') {
|
||||
var connReset = new Error('socket hang up');
|
||||
connReset.code = 'ECONNRESET';
|
||||
connReset.sslError = err && err.message;
|
||||
|
||||
err = connReset;
|
||||
}
|
||||
this.destroy();
|
||||
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);
|
||||
return 0;
|
||||
|
||||
} else if (err == SSL_ERROR_ZERO_RETURN) {
|
||||
handle_->Set(String::New("error"),
|
||||
Exception::Error(String::New("ZERO_RETURN")));
|
||||
return rv;
|
||||
|
||||
} else {
|
||||
HandleScope scope;
|
||||
BUF_MEM* mem;
|
||||
|
Loading…
x
Reference in New Issue
Block a user