[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17334874#comment-17334874
 ] 

Babu Reddy commented on HTTPCLIENT-1698:
----------------------------------------

[~olegk], Even in 4.5.13 version, the verify method(verify(String host, 
X509Certificate cert)), is not recognizing IPV6 host([2001:db8::2:1]) as ipv6 
address because of the square brackets. 

InetAddressUtils.isIPv6Address method always return false if a host with square 
brackets is passed to it. Hence the same exception is thrown even after 
upgrading to 4.5.13 of HttpClient.

> Hostname verification fails when using URL with literal IPv6 address
> --------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1698
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1698
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (classic)
>    Affects Versions: 4.4.1
>            Reporter: Jens Borgland
>            Priority: Minor
>             Fix For: 5.0 Alpha1
>
>
> 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):
> {noformat} 
> Host name '[2001:db8::2:1]' does not match the certificate subject provided 
> by the peer <redacted>
> {noformat} 
> *Expected*: 
> The hostname verification to work 
> ({{org.apache.http.conn.ssl.SSLConnectionSocketFactory}} should feed just the 
> IP address, without square brackets, to the HostnameVerifier).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to