Skip to content

fix(http3): use the client's TLS config - #550

Open
Mootjelh wants to merge 1 commit into
imroc:masterfrom
Mootjelh:http3-tls-config
Open

Mootjelh wants to merge 1 commit into
imroc:masterfrom
Mootjelh:http3-tls-config

Conversation

@Mootjelh

@Mootjelh Mootjelh commented Nov 5, 2026

Copy link
Copy Markdown

Over HTTP/3 the client's TLS settings are ignored. This fails against a server with a self-signed certificate:

c := req.C().EnableForceHTTP3().EnableInsecureSkipVerify()
_, err := c.R().Get(url)
// tls: failed to verify certificate: x509: certificate signed by unknown authority

The same goes for SetRootCertsFromFile and client certificates.

The cause is in internal/http3/transport.go. Since the quic-go v0.51.0 sync (8067517) Transport has its own TLSClientConfig field next to the embedded *transport.Options. Nothing sets it, and it shadows Options.TLSClientConfig, so the dial always gets a nil config. Removing the field makes it read the client's config again.

TestHTTP3UsesTheClientTLSConfig starts a local HTTP/3 server with the test certificate and fails on master with the error above. It passes with this change, and ./internal/http3 passes too.

http3.Transport had a TLSClientConfig field of its own since the quic-go
v0.51.0 sync. Nothing set it, and it hid Options.TLSClientConfig, so
InsecureSkipVerify, RootCAs and client certificates were ignored over
HTTP/3.
Copilot AI balanced review requested due to automatic review settings November 5, 2026 23:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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