diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 24b9472da6b2d4..156853dc33a697 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -1691,14 +1691,12 @@ function onConnectSecure() { debug('client emit secureConnect. rejectUnauthorized: %s, ' + 'authorizationError: %s', options.rejectUnauthorized, this.authorizationError); - this.secureConnecting = false; - this.emit('secureConnect'); } else { this.authorized = true; debug('client emit secureConnect. authorized:', this.authorized); - this.secureConnecting = false; - this.emit('secureConnect'); } + this.secureConnecting = false; + this.emit('secureConnect'); this[kIsVerified] = true; const session = this[kPendingSession];