Repository navigation
reverse_proxy with versions 3 silently ignores tls_trust_pool and verifies against the system roots - #8042
Merged
steadytao merged 2 commits intoSep 21, 2026
Conversation
tippexs
commented
Sep 20, 2026
…pool reuse the config built for the HTTP/1.1+2 transport and give the HTTP/3 transport a clone of it to honour the tls_trust_pool Signed-off-by: Timo Stark <tippexs91@googlemail.com> Co-authored-by: Faiyaz Rahman <faiyazrahman03@gmail.com>
tippexs
force-pushed
the
fix/h3-transport-trust-pool
branch
from
September 20, 2026 20:31
e62f613 to
99a50b8
Compare
WeidiDeng
requested changes
Sep 21, 2026
WeidiDeng
approved these changes
Sep 21, 2026
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Details
Fixes #8041
A reverse_proxy that speaks HTTP/3 to its upstream ignores the CA configured with
tls_trust_pool.Every dial fails with x509: certificate signed by unknown authority, because the HTTP/3 transport is built with
RootCAs == niland Go falls back to the system trust store. I have populated our Certs to this to make it work for now.The same proxy without versions 3 honours the trust pool correctly, which makes this look like a certificate problem rather than a config one.
Minimal reproduction:
An upstream serving HTTP/3 with a certificate from a private CA:
/tls/myRootCa.crt.The running config still shows the pool, which is what makes this hard to spot.
GET /config/returns:{"protocol":"http","tls":{"ca":{"pem_files":["/tls/myRootCa.crt"],"provider":"file"},"server_name":"backend"},"versions":["3"]}Cause (Per my best guess)
HTTPTransport.NewTransportcallsMakeTLSClientConfigtwice:// modules/caddyhttp/reverseproxy/httptransport.go:422 for the HTTP/1.1+2 transport
rt.TLSClientConfig, err = h.TLS.MakeTLSClientConfig(caddyCtx)// modules/caddyhttp/reverseproxy/httptransport.go:507 for the HTTP/3 transport
h.h3Transport.TLSClientConfig, err = h.TLS.MakeTLSClientConfig(caddyCtx)MakeTLSClientConfigreaches the trust pool throughctx.LoadModule(t, "CARaw")andLoadModuleclearsthe raw field on its way out.So on the second call
t.CARawisnil, thecfg.RootCAs = ca.CertPool()branch is skipped, and the HTTP/3 transport gets a config with no roots and falls back.The cost falls entirely on the HTTP/3 path, because RoundTrip prefers h3Transport whenever it exists (
httptransport.go:648). The transport that received the trust pool is never used for requests, the one that serves every request is the one that lost it.Module-backed fields are the only ones affected:
server_name,insecure_skip_verifyandtheclient-certificatepaths are plain struct fields and survive both calls.Build the client config once and give the HTTP/3 transport a clone, rather than calling
MakeTLSClientConfiga second time.Environment
Reproduced on a build from master (September 2026), Alpine container, Go's system roots without the private CA installed. Both call sites and the
LoadModulereset are unchanged in current master.Assistance Disclosure
Claude to trace down the bug and testing. Implementation as well as the bug report Without AI