Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
4.4.1
-
None
Description
Repro steps:
- Set up an HTTPS server with proper certificates (with the IPv6 address as a subject alternative name)
- Set up HttpClient with the DefaultHostnameVerifier
- Try to contact the server using the IPv6 address (in square brackets in accordance with RFC 2732) in the URL, something like: https://[2001:db8::2:1]:443/example
Result:
An SSLPeerUnverifiedException (note the square brackets):
Host name '[2001:db8::2:1]' does not match the certificate subject provided by the peer <redacted>
Expected:
The hostname verification to work (org.apache.http.conn.ssl.SSLConnectionSocketFactory should feed just the IP address, without square brackets, to the HostnameVerifier).