diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 3f3a32fcfcfc23..c2dd958f95106e 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -1688,14 +1688,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];