Repository navigation
fix(ingress): give wildcard certificates their own certbot lineage - #142
Merged
Merged
Conversation
This was referenced Oct 14, 2026
kvinwang
force-pushed
the
fix/ingress-wildcard-lineage
branch
2 times, most recently
from
October 14, 2026 10:37
1d3d802 to
a244c12
Compare
kvinwang
changed the base branch from
fix/ingress-deterministic-key-renewal
to
fix/ingress-acme-server-switch
October 14, 2026 10:37
kvinwang
force-pushed
the
fix/ingress-wildcard-lineage
branch
2 times, most recently
from
October 14, 2026 11:53
b1090c7 to
a2424dd
Compare
kvinwang
added this pull request to stack #150
October 15, 2026 00:39
kvinwang
force-pushed
the
fix/ingress-wildcard-lineage
branch
from
October 15, 2026 01:28
a2424dd to
4fab7f8
Compare
kvinwang
force-pushed
the
fix/ingress-wildcard-lineage
branch
from
October 15, 2026 01:36
4fab7f8 to
261f161
Compare
kvinwang
force-pushed
the
fix/ingress-wildcard-lineage
branch
2 times, most recently
from
October 15, 2026 02:13
9fd7139 to
d585b57
Compare
With both x.com and *.x.com in DOMAINS, certbot names the lineages x.com and x.com-0001, but certman._lineage_name mapped both names to x.com: one of them was served the other's certificate, the evidence attested the wrong certificate, and renewals targeted the wrong lineage. _lineage_name now finds the lineage whose certificate holds exactly the domain, so lineages certbot named itself keep working without being renamed or re-issued. A new lineage is named explicitly: _wildcard.x.com for a wildcard (an underscore cannot appear in a certificate host name), the domain otherwise, with -NNNN appended if another certificate already holds that name. certonly passes it as --cert-name unless it is a --csr issuance, which keeps no lineage. 2.4-2.6 wrote a wildcard's derived-key files under the bare name, so the legacy live/ cleanup looks there. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
force-pushed
the
fix/ingress-wildcard-lineage
branch
from
October 15, 2026 03:53
d585b57 to
3fdaade
Compare
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.
Why
With both
x.comand*.x.cominDOMAINS, certbot names the lineagesx.comandx.com-0001(in issuance order), butcertman._lineage_namemapped both names tox.com. One of them was served the other's certificate, the evidence attested the wrong certificate, andrenew --cert-nametargeted the wrong lineage.What
_lineage_namefinds the lineage whose certificate holds exactly the domain, among<base>,<base>-NNNNand_wildcard.<base>[-NNNN]. Lineages certbot named itself keep working as they are: no rename, no re-issuance._wildcard.x.comfor a wildcard (an underscore cannot appear in a certificate host name, so it never collides with a domain), the domain otherwise, with-NNNNappended if another certificate already holds that name (e.g. a wildcard-only deployment that later adds the base).certonlypasses it as--cert-nameunless it is a--csrissuance, which keeps no lineage.live/cleanup (fix(ingress): keep deterministic TLS keys across renewals #132) looks under the bare name, where those versions put a wildcard's files.LETSENCRYPT_DIRat a temp tree.On an upgrade that needs no issuance, haproxy serves the right certificates at once;
/evidencesis republished at start with #138, otherwise at the next renewal.Tested against Pebble with
ghcr.io/dstack-tee/dstack-ingress:2.6and these scripts mounted, 3 passes each:xand_wildcard.x, each SNI served its own certificate, then no-ops.x=*.x,x-0001=xand the reverse): no issuance, no rename, each SNI served right; forced renewal renews the right lineage in place.x-0001, wildcard untouched.x-0001, both served right.DETERMINISTIC_TLS_KEY=true, fresh and from the 2.4–2.6 layout with the wildcard under the bare name: each served its own derived key, at most one issuance per name.DELEGATION_ZONE: generated commands only.