Skip to content

fix(connect): strip brackets from IPv6 hosts when building the ServerName - #3095

Open
kp-patrick-arns wants to merge 2 commits into
seanmonstar:masterfrom
kp-patrick-arns:fix-ipv6-server-name
Open

fix(connect): strip brackets from IPv6 hosts when building the ServerName#3095
kp-patrick-arns wants to merge 2 commits into
seanmonstar:masterfrom
kp-patrick-arns:fix-ipv6-server-name

Conversation

@kp-patrick-arns

Copy link
Copy Markdown

Closes #3094

Adds a helper that strips the brackets off an IPv6 literal host and uses it at both ServerName::try_from call sites in src/connect.rs, the SOCKS path and the HTTP CONNECT tunnel.
This is what HttpsConnector already does on the direct path.

#2753 fixed the other direction in this file, adding brackets when formatting a SOCKS destination, but the ServerName construction a few lines away kept the bracketed host.

The native-tls paths are untouched. They pass the host on differently and I have not checked whether they have the same problem.

tunnel_to_ipv6_literal in tests/proxy.rs covers it: the proxy answers 200 so the client goes on to the handshake, which is where the rejection happened. Without the fix the test fails with "Invalid Server Name".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Invalid Server Name" when requesting an IPv6 literal through a proxy

1 participant