diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 6d07272c7c10a7..246fabcc339861 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -426,7 +426,11 @@ TLSSocket.prototype._init = function(socket, wrap) { // Destroy socket if error happened before handshake's finish if (!self._secureEstablished) { - self.destroy(self._tlsError(err)); + if (!self._controlReleased) { + self.destroy(err); + } else { + self.destroy(self._tlsError(err)); + } } else if (options.isServer && rejectUnauthorized && /peer did not return a certificate/.test(err.message)) {