Skip to content

fix(cyper): handle IPv6 address in HTTP and HTTP/3 connectors#51

Merged
Berrysoft merged 2 commits intocompio-rs:masterfrom
AutumnSolutions:master
Mar 12, 2026
Merged

fix(cyper): handle IPv6 address in HTTP and HTTP/3 connectors#51
Berrysoft merged 2 commits intocompio-rs:masterfrom
AutumnSolutions:master

Conversation

@WhiteAutumn
Copy link
Copy Markdown
Contributor

Uri::host() returns IPv6 addresses with brackets (e.g. [::1]) per RFC 3986. When connecting to an IPv6 literal like https://[::1]:8443/, the bracketed host string is passed to both TCP address resolution and TLS SNI, causing connection failures as the address can't be parsed as an Ipv6Addr and falls through to a DNS lookup that fails.

http3.rs already stripped brackets for the TLS server name but not for address resolution. stream.rs didn't strip them at all.

This PR strips the brackets immediately after extracting the host in both connectors.

`Uri::host()` returns IPv6 addresses with brackets (e.g. `[::1]`)
per RFC 3986. These brackets caused TCP connection and TLS handshake
failures because neither address parsing nor SNI accept bracketed
literals.

Strip the brackets immediately after extracting the host in both the
HTTP/1.1+2 connector (`stream.rs`) and the HTTP/3 connector
(`http3.rs`).
@Berrysoft Berrysoft changed the title Fix IPv6 address handling in HTTP and HTTP/3 connectors fix(cyper): handle IPv6 address in HTTP and HTTP/3 connectors Mar 12, 2026
@Berrysoft Berrysoft merged commit 8fb4f7a into compio-rs:master Mar 12, 2026
27 checks passed
@Berrysoft
Copy link
Copy Markdown
Member

Thanks!

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.

2 participants