Skip to content

tls: fix IPv6 hostname verification regression#64128

Open
Paraspandey-debugs wants to merge 1 commit into
nodejs:mainfrom
Paraspandey-debugs:main
Open

tls: fix IPv6 hostname verification regression#64128
Paraspandey-debugs wants to merge 1 commit into
nodejs:mainfrom
Paraspandey-debugs:main

Conversation

@Paraspandey-debugs

Copy link
Copy Markdown

The previous normalization logic applied domainToASCII() to all hostnames, which returns an empty string for raw IPv6 addresses. This caused the IP SAN check to be skipped and verification to incorrectly fall back to domain matching. This patch moves the IP address check before any IDNA conversion, ensuring IPv6 (and IPv4) addresses are compared directly against the certificate's IP Subject Alternative Names.

Adds regression tests for IPv6 SAN verification.

Fixes: #64032

The previous normalization logic applied domainToASCII() to all hostnames,
which returns an empty string for raw IPv6 addresses. This caused the IP SAN
check to be skipped and verification to incorrectly fall back to domain
matching. This patch moves the IP address check before any IDNA conversion,
ensuring IPv6 (and IPv4) addresses are compared directly against the
certificate's IP Subject Alternative Names.

Adds regression tests for IPv6 SAN verification.

Fixes: nodejs#64032
Signed-off-by: Paraspandey-debugs <p.pandey250806@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. tls Issues and PRs related to the tls subsystem. labels Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. tls Issues and PRs related to the tls subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TLS verification fails for IPv6 IP subjectAltName in v22.23.0 and v24.17.0

2 participants