Repository navigation
Always send the configured client certificate to HTTP stores - #444
Merged
Merged
Conversation
Owner
|
Thanks for the PR, the change itself looks good. The Lint job is failing in CI, though. Could you run golangci-lint locally (CI pins v2.12) and push a fix? go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12
golangci-lint runMy guess is errcheck flagging the unchecked |
Go's default client certificate selection sends no certificate when the server's CertificateRequest doesn't list the issuing CA. Set GetClientCertificate so the configured certificate is always presented, as curl and OpenSSL-based clients do. Fixes folbricht#443 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
golangci-lint's errcheck only exempts deferred Close calls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shibuya-r
force-pushed
the
client-cert-always-send
branch
from
October 5, 2026 12:13
4dadb00 to
8c7f8e0
Compare
Contributor
Author
|
Thanks for the review! You were right, it was errcheck on the unchecked
|
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.
Fixes #443
When a client certificate is configured for a network store,
tlsClientConfig()sets onlytls.Config.Certificates. Go then sends the certificate only if its issuer appears in the server'sCertificateRequestCA list. Otherwise it sends no certificate, and the handshake fails withtls: certificate required.That breaks TLS terminators that advertise a fixed set of public CAs and forward the client certificate to the backend for verification. Azure Container Apps' ingress mTLS (
clientCertificateMode: require) is one of them.This PR sets
GetClientCertificateto always return the configured certificate, the same waycurl --certand OpenSSL-based clients behave. The server still decides whether to accept it, so verification is not weakened. Setups where the server advertises the issuing CA, such as desync's ownchunk-server --mutual-tls --client-ca, behave the same as before.Changes
store.go: settls.Config.GetClientCertificatealongsideCertificates.store_tls_test.go(new): starts a TLS server that requires a client certificate and advertises an unrelated CA. Checks that the certificate issued by another CA still reaches the server.Testing
go test -run TestTLSClientCertSentRegardlessOfAcceptableCAs .: fails without thestore.gochange (remote error: tls: certificate required) and passes with it.go vetandgofmtare clean. On macOS,TestExtractWithNonStaticSeedsandTestTarfail on unmodified v1.1.4 too, so they are not related to this change.🤖 Generated with Claude Code