tlsutil: add CAReloader for dynamic CA certificate reloading #21156
+631
−0
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
Add CAReloader that polls CA files and updates the certificate pool when changes are detected (using SHA256 hashing). This enables zero-downtime CA rotation for mTLS clusters.
Changes
CAReloaderstruct withStart()/Stop()lifecycle managementsync.RWMutexfor thread-safe pool accesssync.WaitGroupfor graceful shutdown (follows etcd patterns)etcd_tlsutil_ca_reload_*)Background
This PR is a split of #21074 into smaller, reviewable pieces as requested by maintainers.
Stacking
This PR is part of a stacked PR series for CA hot-reload support (issue #11555):
tlsutil: add CAReloadertransport,embed: integrate CA hot-reload supporttests: add CA rotation integration testPart 1 of 3 for CA hot-reload support.
Replaces #21074 (split into smaller PRs)
Partially fixes #11555
Signed-off-by: Amir Omidi amir@aaomidi.com