hyperium / hyper-tls

Apache License 2.0
189 stars 95 forks source link

Cannot connect to URLs with IP literals #68

Closed edevil closed 4 years ago

edevil commented 4 years ago

Connecting to URLs like https://[2606:4700:4700::1111]/ fails due to the hostname verification (SNI). This library passes the host() returned by the URI package here, but the value returned for this URL is [2606:4700:4700::1111]/.

This fails TLS hostname verification because not only do the brackets have to be removed, but the IPv6 literal also has to observe specific rules regarding zero compression and suppression. spec

In this case the correct name to pass to the TLS library would be 2606:4700:4700:0:0:0:0:1111.

seanmonstar commented 4 years ago

Fixed by #69