Repository navigation
refactor(gateway)!: replace the file-configured proxy certificate with Admin.ImportCert - #1239
Merged
Merged
Conversation
This was referenced Sep 20, 2026
kvinwang
force-pushed
the
fix/gateway-cert-store-reload
branch
from
September 24, 2026 08:40
da59681 to
39f96e8
Compare
`CertStoreBuilder::add_cert` decided whether a certificate was still valid from `CertData.not_after` alone, a replicated field, and never looked at the `notAfter` of the chain it was about to serve. A record claiming `u64::MAX` over an expired chain installed on every node that replicated it. Both now have to be in the future. A record that outlives its chain delays renewal, so it is logged. `get_cert_expiry` moves to `cert_store` so there is one copy.
…h Admin.ImportCert `[core.proxy] cert_chain`/`cert_key` installed a certificate that lived in no KV key, so any cert store reload built from KV dropped it, taking `<id>.<base_domain>` routing down with it. Production deployments do not set it: certificates are issued by the distributed certbot and kept in KV. Remove it, and `base_domain`, which only named the domain for it. A certificate issued elsewhere is now installed with `Admin.ImportCert`, which stores it in KV like an issued one, so it replicates and survives reloads. The gateway does not renew it. The proxy data-path suite imports its test certificate through the RPC; the cluster suite and dev-stack.sh no longer configure one.
kvinwang
force-pushed
the
fix/gateway-cert-store-reload
branch
from
September 24, 2026 12:58
d4ae044 to
cf0f3d0
Compare
kvinwang
added a commit
that referenced
this pull request
Sep 25, 2026
PR #1239 removed the file-configured proxy certificate. The isolated gateway fixture and tc-gos-setup-009 now import their *.localhost certificate through the admin API, tc-gw-internal-001 asserts the removed keys stay absent and the imported certificate survives a restart, and tc-gw-certificat-006 counts the new expired-chain test. The new tc-gw-admin-037 covers the ImportCert contract on a three-node cluster. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 8, 2026
PR #1239 removed the file-configured proxy certificate. The isolated gateway fixture and tc-gos-setup-009 now import their *.localhost certificate through the admin API, tc-gw-internal-001 asserts the removed keys stay absent and the imported certificate survives a restart, and tc-gw-certificat-006 counts the new expired-chain test. The new tc-gw-admin-037 covers the ImportCert contract on a three-node cluster. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 8, 2026
PR #1239 removed the file-configured proxy certificate. The isolated gateway fixture and tc-gos-setup-009 now import their *.localhost certificate through the admin API, tc-gw-internal-001 asserts the removed keys stay absent and the imported certificate survives a restart, and tc-gw-certificat-006 counts the new expired-chain test. The new tc-gw-admin-037 covers the ImportCert contract on a three-node cluster. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 10, 2026
PR #1239 removed the file-configured proxy certificate. The isolated gateway fixture and tc-gos-setup-009 now import their *.localhost certificate through the admin API, tc-gw-internal-001 asserts the removed keys stay absent and the imported certificate survives a restart, and tc-gw-certificat-006 counts the new expired-chain test. The new tc-gw-admin-037 covers the ImportCert contract on a three-node cluster. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 11, 2026
PR #1239 removed the file-configured proxy certificate. The isolated gateway fixture and tc-gos-setup-009 now import their *.localhost certificate through the admin API, tc-gw-internal-001 asserts the removed keys stay absent and the imported certificate survives a restart, and tc-gw-certificat-006 counts the new expired-chain test. The new tc-gw-admin-037 covers the ImportCert contract on a three-node cluster. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 11, 2026
PR #1239 removed the file-configured proxy certificate. The isolated gateway fixture and tc-gos-setup-009 now import their *.localhost certificate through the admin API, tc-gw-internal-001 asserts the removed keys stay absent and the imported certificate survives a restart, and tc-gw-certificat-006 counts the new expired-chain test. The new tc-gw-admin-037 covers the ImportCert contract on a three-node cluster. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 16, 2026
PR #1239 removed the file-configured proxy certificate. The isolated gateway fixture and tc-gos-setup-009 now import their *.localhost certificate through the admin API, tc-gw-internal-001 asserts the removed keys stay absent and the imported certificate survives a restart, and tc-gw-certificat-006 counts the new expired-chain test. The new tc-gw-admin-037 covers the ImportCert contract on a three-node cluster. Signed-off-by: Kevin Wang <wy721@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two changes to the gateway certificate store.
[core.proxy] cert_chain/cert_key(andbase_domain). The configured certificate lived in no KV key, so every cert store reload built from KV dropped it and<id>.<base_domain>routing stopped for the whole base domain. Production deployments do not set it; certificates are issued by the distributed certbot and kept in KV.base_domainonly named the domain for that certificate and is otherwise unread.A certificate issued elsewhere is now installed with the new
Admin.ImportCert(domain, cert_pem, key_pem), which stores it in KV like an issued one, so it replicates and survives reloads. The gateway does not renew it.Breaking: these keys are now ignored. Deployments that set them must import the certificate through the admin API instead.
add_certonly checked the replicatedCertData.not_after, not the X.509notAfterof the chain it serves, so a record withnot_after = u64::MAXinstalled an expired chain. It now requires both.Test harnesses: the proxy data-path suite imports its certificate through
ImportCert; the cluster suite andtools/dev-stack.shno longer configure one.Verification:
cargo test -p dstack-gateway320 passed; clippy and fmt clean.test-run/proxy-e2e/run-proxy-tests.sh: 69 passed / 1 skipped (main), 67 passed / 1 skipped (no-TLS-ULP container); every arm reaches readiness only afterImportCertsucceeds.