Reload rotated client certificates in the TLS check #25363
All Vouch review confidence checks passed
Residual risk 0.39 = Change Risk (0.66) × (1 − Review Confidence (0.40)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.66 · 373 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.354
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.066
Real PR Conversation Timeline
1 comments
"Review active on #25363"
general
weight: 0.35
iliakur
What does this PR do?
Reload the TLS integration's SSL context before each remote certificate check so rotated client certificates and keys take effect without restarting the Agent. Strictly load configured client credentials before the handshake: missing, unreadable, malformed, or mismatched files produce CRITICAL
tls.validationand no certificate-age metrics, with automatic recovery when valid credentials are available.Preserve downloaded intermediate CA certificates across refreshes only while their originating URI cache entries remain valid. Expired entries leave both the cache and refreshed trust store, including when discovery or refetching fails. Continue AIA traversal through cached intermediates so expired parents can be renewed. Validate downloaded DER with OpenSSL before caching it.
Keep per-run refresh to detect replacements that preserve file timestamps, and avoid creating a second SSL context on the first use. Document the transient failure during non-atomic rotation in
tls/changelog.d/25363.fixed.Motivation
The remote TLS check caches its SSL context for the lifetime of the check instance. When a certificate manager rotates the configured client certificate and key on disk, subsequent checks continue presenting the original certificate. Once that certificate expires, the server rejects it even though valid replacement files exist.
Validation:
ddev --no-interactive test tls: 85 passed, 6 skipped. The skips are the five E2E/FIPS tests excluded from this invocation and an existing test disabled for an expired external certificate.2d604ee1) and pass with these fixes.ddev --no-interactive test --lint tls: passed.QA is required; a maintainer needs to add
qa/requiredbecause the author account cannot apply labels.QA should exercise a long-running Agent across client-certificate rotation and expiry of the original certificate, including
fetch_intermediate_certs. Verify replacement credentials reach the endpoint, incomplete rotations report CRITICAL without age metrics, and monitoring recovers once the files form a valid pair.Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged