Fix SSL hot-reload to rebuild trust store instead of validating all CA dates#6136
Conversation
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 17156e9.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Reviewer Guide 🔍(Review updated until commit 17156e9)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 17156e9
Previous suggestionsSuggestions up to commit 89e074a
|
…A dates During certificate hot-reload, when authority certificates change, the previous code called validateDates() on all new authority certificates. This caused hot-reload to fail when the trust store contained expired certificates that were not in the chain of the node certificate (e.g., rotated intermediate CAs from ACM). This change replaces validateDates() with trustStoreFactory() which rebuilds the trust store properly, allowing hot-reload to succeed as long as the certificates relevant to the node's chain are valid. Signed-off-by: Shubham Kumar <shubhmkr@amazon.com>
89e074a to
17156e9
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6136 +/- ##
==========================================
+ Coverage 74.75% 74.81% +0.05%
==========================================
Files 447 447
Lines 28480 28480
Branches 4331 4331
==========================================
+ Hits 21291 21307 +16
+ Misses 5193 5182 -11
+ Partials 1996 1991 -5
🚀 New features to boost your workflow:
|
|
Persistent review updated to latest commit 17156e9 |
Description
PR #4979 fixed certificate validation during node bootup to only check certs in the chain of the node certificates. However, the hot-reload path in
SslContextHandler.reloadSslContext()still callsvalidateDates()on all authority certificates. This causes hot-reload to fail when the trust store contains expired certificates that are not part of the node certificate's chain.This PR replaces
validateDates(newAuthorityCertificates)withsslConfiguration.trustStoreFactory()in the hot-reload path, which rebuilds the trust store and delegates validation to the trust store factory that already handles chain filtering per #4979.Issues Resolved
Related: #4949
Testing
sslContextReloadSucceedsWithValidIssuerAndExpiredIrrelevantCertificatesCheck List