tls: match IPv6 hosts against IP-Address SANs · nodejs/node@b9104de · GitHub
Skip to content

Commit b9104de

Browse files
JumpLinkaduh95
authored andcommitted
tls: match IPv6 hosts against IP-Address SANs
checkServerIdentity() stopped matching an IPv6 host against a matching IP-Address SAN. The hostname is now run through domainToASCII() before the net.isIP() gate, and domainToASCII('::1') === '' (an IPv6 literal is not a domain), so net.isIP('') is 0, the IP-SAN branch is skipped, and verification fails with "Cert does not contain a DNS name". IPv4 is unaffected because dotted-decimal survives domainToASCII(). Match IP hosts against the original hostname instead of the IDNA- normalized one. net.isIP() rejects non-ASCII input, so there is no IDNA confusion to guard against for an IP literal; the normalized form is still used for the DNS-name path. Fixes: #64144 Signed-off-by: Pascal Garber <pascal@artandcode.studio> PR-URL: #64145 Reviewed-By: Tim Perry <pimterry@gmail.com>
1 parent 3f8b446 commit b9104de

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

lib/tls.js

Lines changed: 8 additions & 2 deletions

test/parallel/test-tls-check-server-identity.js

Lines changed: 21 additions & 0 deletions

0 commit comments

Comments
 (0)