diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 8d988cbdbc3b90..1a4dad0bf7dd6f 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -1052,7 +1052,7 @@ function onConnectSecure() { options.host || (options.socket && options.socket._host) || 'localhost'; - const cert = this.getPeerCertificate(); + const cert = this.getPeerCertificate(true); verifyError = options.checkServerIdentity(hostname, cert); }