Commit 0a34dd9
fix: can't resolve ip address with square brackets
Problem:
Sending to destination like https://[::1]/ fails with error invalid dnsname.
Error is thrown here https://github.com/rustls/hyper-rustls/blob/main/src/connector.rs#L95
hyper-rustls resolves the Hostname as hyper::Uri::host
This makes hostname = "[::1]" which is HTTP-specific form of writing IPv6 address.
Solution:
Since square brakets are coming from hyper and not part standard IP notation
we remove any square brakets inside of the connector before calling
the rustls::ServerName::try_from(hostname)1 parent 141eb5f commit 0a34dd9
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
92 | 101 | | |
93 | 102 | | |
94 | 103 | | |
| |||
0 commit comments