[php-src] PR #22038: ext/openssl: Match IPv6 IPADDR SAN when connecting to bracketed URI
| From: | iliaal | Date: | Wed, 13 May 2026 20:18:26 +0000 |
| Subject: | [php-src] PR #22038: ext/openssl: Match IPv6 IPADDR SAN when connecting to bracketed URI | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36119@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22038
Author: iliaal
Default-config TLS client cannot match an IPADDR SAN entry covering an IPv6 literal because
php_openssl_get_url_name() returns NULL for resourcenames of the form
[::1]:port. php_url_parse_ex() cannot extract a host from a bracketed
hostport when no scheme is present, so url_name ends up unset, the SAN matcher's
inet_pton(AF_INET6, ...) call never happens, and verify_peer_name rejects
every legitimate IPv6 target.
Handle the bare [host]:port shape before php_url_parse_ex() and strip
surrounding brackets on the parse path for callers that pass a full ssl://[::1]:port
URL. The SAN matcher now sees ::1 and the 16-byte IPADDR SAN comparison body runs.
Covered by ext/openssl/tests/peer_verification_ipv6_san.phpt.