Skip to content

fix(gateway): drop the unused exact-cert map and reject an empty SNI label - #1603

Merged
kvinwang merged 1 commit into
nextfrom
fix/gateway-cert-store-exact
Nov 18, 2026
Merged

kvinwang merged 1 commit into
nextfrom
fix/gateway-cert-store-exact

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

CertStore::exact_certs was never populated: add_cert, the only way in, stores every certificate as the wildcard for its base domain. Its lookup branch in resolve_cert was dead, so it is removed. resolve_cert also accepted an empty first label (.example.com resolved to the example.com wildcard); it now returns None.

Not reachable today, since rustls rejects an SNI with an empty label before the resolver runs; this stops the resolver from relying on that.

Found by the Lean model of the store (#1597, CertStore.lean).

kvinwang added a commit that referenced this pull request Nov 18, 2026
CertLock follows #1599-#1601 on wavekv 2.2: the lock value carries a
nonce, a lease stamped beyond the drift bound counts as expired, and
release and lease-guarded writes are no-ops once the lease expired by the
local clock. The force-release, clock-step-back and stale-release
counterexamples become positive theorems: ownership on one node under any
clock, and a release or guarded commit losing LWW to any successor whose
clock is within the drift bound. The replication gap, skew beyond the
drift bound, and cross-node force release remain as counterexamples.

Sni follows #1602: the returned name lies within every declared block.
CertStore follows #1603: no exact-match table, empty first label refused.

Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang enabled auto-merge November 18, 2026 08:46
CertStore kept an exact_certs map that nothing ever filled: add_cert, the
only way in, stores every certificate as the wildcard for its base domain,
and update_cert and the KvStore reloads all go through it. Remove the map
and the exact-match branch of resolve_cert.

resolve_cert also took ".example.com" as a subdomain of example.com and
served the *.example.com certificate for it. rustls already refuses such
an SNI as an invalid DNS name before the resolver runs, so this is not
reachable today; reject the empty label in the resolver itself rather than
relying on that.

Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang force-pushed the fix/gateway-cert-store-exact branch from e21f36e to 6721051 Compare November 18, 2026 09:52
@kvinwang
kvinwang merged commit f64fec6 into next Nov 18, 2026
21 checks passed
@kvinwang
kvinwang deleted the fix/gateway-cert-store-exact branch November 18, 2026 10:01
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.

1 participant