transport,embed: integrate CA hot-reload support #21157
Open
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
Integrate CAReloader into the transport layer for both server and client TLS configurations. Add server flags to enable the feature.
Changes
Transport layer:
CAReloaderfield toTLSInfofor dynamic CA updatesVerifyConnectioncallback with dynamic CA poolDialTLSContextto inject fresh RootCAs per connectionServer flags:
--peer-tls-reload-ca: Enable dynamic reloading of peer trusted CA certificates--client-tls-reload-ca: Enable dynamic reloading of client trusted CA certificates--tls-ca-reload-interval: Interval for checking CA file changes (default 10s)Lifecycle management:
Etcdstruct owns CAReloader lifecycleStartEtcd()before listener configurationEtcd.Close()The feature is disabled by default and must be explicitly enabled.
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 CAReloader← must be merged firsttransport,embed: integrate CA hot-reload supporttests: add CA rotation integration testPlease review #21156 first.
Part 2 of 3 for CA hot-reload support.
Replaces #21074 (split into smaller PRs)
Partially fixes #11555
Signed-off-by: Amir Omidi [email protected]