Repository navigation
httpcaddyfile: reject conflicting client_auth when merging TLS policies - #8306
Merged
steadytao merged 4 commits intoNov 4, 2026
Merged
Conversation
Member
|
Site addresses like |
Member
|
Assistance disclosure must also be explicit** |
Contributor
Author
|
Done |
steadytao
requested changes
Nov 3, 2026
steadytao
approved these changes
Nov 4, 2026
francislavoie
pushed a commit
that referenced
this pull request
Nov 5, 2026
…es (#8306) * httpcaddyfile: reject conflicting client_auth when merging TLS policies * httpcaddyfile: use host and host:port site addresses in client auth conflict test * httpcaddyfile: enhance client auth consolidation test to handle conflicting configurations * httpcaddyfile: remove unnecessary blank line in conflict error handling (cherry picked from commit c1c0ee5)
5 tasks
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.
consolidateConnPoliciesonly reported a client auth conflict when the first of two same-matcher TLS policies had none. When both setclient_authdifferently, the merge kept the first and silently dropped the second, so a stricter mTLS setting could vanish without any warning.Repro, adapts with no error on master:
The adapted config ends up with one policy for
sni: example.comwith onlymode: request, andGET /adminreturns 200 without a client certificate (checked end to end with the same config onlocalhost+tls internal). Anexample.comblock plus anexample.com:443block hits the same path. This now fails to adapt with the existing "conflicting client auth configuration" error, same as the other conflicting fields. The case where only one of the two policies sets client auth behaves as before. Added a test that fails before and passes after.Assistance Disclosure
The bug was surfaced by AI-assisted analysis, with the patch, and the test. I reviewed them before submitting. The repro above was adapted against master and this branch, and the new test was run against both;
go build ./...,go test -short -race ./...andgolangci-lint runpass in CI on linux, mac, windows.