Skip to content

fix(gateway): reject expired certificate reloads - #931

Merged
kvinwang merged 3 commits into
masterfrom
codex/fix-gateway-expired-cert-reload
Aug 5, 2026
Merged

fix(gateway): reject expired certificate reloads#931
kvinwang merged 3 commits into
masterfrom
codex/fix-gateway-expired-cert-reload

Conversation

@kvinwang

@kvinwang kvinwang commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Problem

Gateway certificate reloads accepted expired replacement certificates. Installing one could replace a working in-memory identity and immediately break TLS handshakes.

A naive validity check in the store builder also caused an expired certificate for one domain to block an unrelated domain from being renewed, because incremental updates rebuilt and revalidated the entire store.

Fix

  • reject an expired candidate certificate before atomically installing it
  • clone already-installed certificate entries without revalidating them during an incremental update
  • continue validating each entry during full store construction/reload, where invalid entries are skipped independently
  • retain the current certificate when a replacement is rejected

The branch is rebuilt on current master; the certificate/key pairing validation from #917 remains provided by master.

Verification

  • cargo fmt --manifest-path dstack/Cargo.toml --all
  • cargo check --manifest-path dstack/Cargo.toml -p dstack-gateway
  • cargo test --manifest-path dstack/Cargo.toml -p dstack-gateway cert_store::tests -- --nocapture
  • git diff --check

Copilot AI review requested due to automatic review settings July 31, 2026 03:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Base automatically changed from codex/fix-gateway-cert-key-match to master August 4, 2026 15:25
@kvinwang
kvinwang force-pushed the codex/fix-gateway-expired-cert-reload branch from 54efaa2 to c269d2a Compare August 4, 2026 15:25
@kvinwang kvinwang changed the title [STACKED on #917] fix(gateway): reject expired certificate reloads fix(gateway): reject expired certificate reloads Aug 5, 2026
@kvinwang
kvinwang force-pushed the codex/fix-gateway-expired-cert-reload branch from c269d2a to f938659 Compare August 5, 2026 01:55
@kvinwang
kvinwang merged commit 59e5409 into master Aug 5, 2026
16 checks passed
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