diff --git a/lib/tls.js b/lib/tls.js index f771a661d07692..57228ca273cb98 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -176,7 +176,7 @@ exports.checkServerIdentity = function checkServerIdentity(hostname, cert) { let uri; try { uri = new URL(name.slice(4)); - } catch (err) { + } catch { uri = url.parse(name.slice(4)); if (!urlWarningEmitted && !process.noDeprecation) { urlWarningEmitted = true;