Skip to content

Revert "Fail fast on invalid certificates at TLS config load (#2999)" - #5574

Closed
dmitrypol wants to merge 1 commit into
valkey-io:unstablefrom
dmitrypol:revert-pr-2999
Closed

dmitrypol wants to merge 1 commit into
valkey-io:unstablefrom
dmitrypol:revert-pr-2999

Conversation

@dmitrypol

Copy link
Copy Markdown
Contributor

This reverts commit eb3f465.

Resolve conflicts with subsequent TLS changes by removing dependent validity checks and eager CA directory loading, while preserving certificate telemetry and dual-certificate support.

…io#2999)"

This reverts commit eb3f465.

Resolve conflicts with subsequent TLS changes by removing dependent validity checks and eager CA directory loading, while preserving certificate telemetry and dual-certificate support.

Signed-off-by: dmitrypol <dmitrypol@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

TLS configuration no longer rejects server or CA certificates based on validity dates. The TLS tests and certificate-generation script remove the related invalid-certificate cases and assets.

Changes: TLS certificate validity handling

Layer / File(s) Summary
TLS validity handling and test cleanup
src/tls.c, utils/gen-test-certs.sh, tests/unit/tls.tcl, tests/README.md
TLS setup no longer checks server or CA certificate validity dates. CA locations still load through SSL_CTX_load_verify_locations, and failures still abort configuration. The test suite and certificate-generation materials remove the expired and not-yet-valid certificate cases.

Estimated code review effort: 2 (Simple) | ~15 minutes

Severity of issue fixed: Medium

Possibly related issues

  • valkey-io/valkey#5506: The issue reports that an expired certificate in tls-ca-cert-file aborts TLS setup. This change removes the CA certificate validity checks.

Suggested reviewers: yang-z-o, pkhartsk

Merge Risk: Minimal · up to 52339

This revert removes the fail-fast rejection of expired or not-yet-valid TLS certificates during configuration loading, and it removes the tests and generated assets that covered that behavior. The effect is the intended return to the earlier behavior, and no concrete defect was found in the remaining TLS configuration paths. Merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states that the PR reverts commit #2999, which added fail-fast validation of invalid certificates at TLS config load. The changeset removes the validity-date checks in createSSLContext, the …
Description check Passed The description says the commit is reverted to resolve conflicts with later TLS changes. It names the removed validity checks and eager CA directory loading, and it names the preserved telemetry and d…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states that the PR reverts commit #2999, which added fail-fast validation of invalid certificates at TLS config load. The changeset removes the validity-date checks in createSSLContext, the CA directory loading, and the related tests and script generation. The title names the main change, so it passes.

Full details: Description check

Explanation

The description says the commit is reverted to resolve conflicts with later TLS changes. It names the removed validity checks and eager CA directory loading, and it names the preserved telemetry and dual-certificate support. The description matches the changeset, so it passes.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9e74a49a-940a-4e00-85ee-e1708fd8f19f
Commits

Reviewing files that changed from the base of the PR and between b5c423a and 5233975.

Files selected for processing: 4

  • src/tls.c
  • tests/README.md
  • tests/unit/tls.tcl
  • utils/gen-test-certs.sh
Files with no reviewable changes: 2

  • tests/unit/tls.tcl
  • utils/gen-test-certs.sh

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@dmitrypol

Copy link
Copy Markdown
Contributor Author

address #5506

@valkey-review-bot

Copy link
Copy Markdown
Contributor

Review state

Ready for human review.
The revert is complete and has no open findings. It removes isCertValid, loadCaCertDir, areAllCaCertsValid, their call sites in createSSLContext, the fail-fast Tcl tests and the invalid-cert generation in gen-test-certs.sh. No references remain, the INFO tls CA telemetry reads cert files itself and does not depend on the X509 store, and valkey-server builds with BUILD_TLS=yes.

Risk: Low. Expired or not-yet-valid TLS certs and CAs are accepted again at startup and on CONFIG SET, as before #2999. Peers then reject them at handshake time instead of the server refusing to load them.

Open findings: none.

Backport: Unclear. This is a revert, not a bug fix. upstream/9.2 carries the #2999 code (areAllCaCertsValid at src/tls.c:586) and older lines do not, so maintainers need to decide whether 9.2 should get the same revert.

Updated for 5233975 at 2026-11-24 01:19 UTC. The bot rewrites this comment on every review.

@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.72%. Comparing base (b5c423a) to head (5233975).

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #5574      +/-   ##
============================================
+ Coverage     81.56%   81.72%   +0.16%     
============================================
  Files           199      199              
  Lines        105013   105013              
============================================
+ Hits          85656    85825     +169     
+ Misses        19357    19188     -169     
Files with missing lines Coverage Δ
src/tls.c 88.88% <ø> (ø)

... and 21 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@madolson

Copy link
Copy Markdown
Member

Was already merged in #5550

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants