fix: append custom CA to system cert pool instead of replacing it#227
Merged
fix: append custom CA to system cert pool instead of replacing it#227
Conversation
PR #212 introduced ca.crt support for server verification but used x509.NewCertPool(), which replaces the system CA bundle entirely. This breaks connections to Temporal Cloud (public CA) when the mTLS secret contains a ca.crt from cert-manager (the client CA). Use x509.SystemCertPool() instead so the custom CA is appended to the system bundle, allowing both private and public CAs to be trusted. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
carlydf
approved these changes
Mar 10, 2026
Collaborator
carlydf
left a comment
There was a problem hiding this comment.
Makes sense to me. Let's try this. To test without having to cut another potentially bad v1.2.x patch release, can we test it in our dogfooding test env by just using the main image?
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.
Summary
ca.crtsupport for server certificate verification but usedx509.NewCertPool(), which creates an empty CA pool — replacing the system CA bundle entirelyca.crtkey from cert-manager (the CA that signed the client cert, not the server cert)x509.SystemCertPool()instead, so the custom CA is appended to the system bundle rather than replacing itWhy this broke
cert-manager always includes
ca.crtin TLS secrets (the issuing CA). When connecting to Temporal Cloud:ca.crtin the secret (the self-signed client CA)NewCertPool()creates an empty pool with only that CAx509: certificate signed by unknown authorityWhat this fixes
SystemCertPool()loads the system CA bundle first, then appends the custom CANewCertPool()with a warning log if the system pool can't be loadedAffected versions
Test plan
ca.crt) — verify connection succeedsca.crt— verify fallback to system bundle works🤖 Generated with Claude Code