Skip to content

handshake: avoid expired wildcard cache match on demand#388

Open
cyphercodes wants to merge 1 commit into
caddyserver:masterfrom
cyphercodes:fix-expired-wildcard-cache-on-demand
Open

handshake: avoid expired wildcard cache match on demand#388
cyphercodes wants to merge 1 commit into
caddyserver:masterfrom
cyphercodes:fix-expired-wildcard-cache-on-demand

Conversation

@cyphercodes

Copy link
Copy Markdown

Fixes #384.

When an on-demand handshake for an exact SNI only finds an expired wildcard certificate in the shared cache, do not try to maintain and serve that wildcard certificate. Instead, continue down the exact SNI path: load the exact certificate from storage if present, or obtain one on demand.

This keeps normal wildcard cache reuse unchanged for non-expired wildcard certificates, while preventing an expired wildcard from short-circuiting exact-name issuance.

Tests:

  • go test ./...
  • go test -run TestGetCertDuringHandshakeExpiredWildcardCacheObtainsExact -count=1 ./

Signed-off-by: cyphercodes <cyphercodes@users.noreply.github.com>
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.

Expired wildcard cert keeps being served for newly-added specific subdomains

1 participant