Skip to content

add --preferred-chain flag to select alternate ACME certificate chains#310

Open
baru wants to merge 1 commit into
diafygi:mainfrom
baru:preferred-chain
Open

add --preferred-chain flag to select alternate ACME certificate chains#310
baru wants to merge 1 commit into
diafygi:mainfrom
baru:preferred-chain

Conversation

@baru

@baru baru commented Jun 7, 2026

Copy link
Copy Markdown

Let's Encrypt serves multiple chains via Link: rel="alternate" headers. The default chain for YR2-signed certs omits ISRG Root YR, a cross-signed intermediate. Clients that don't perform AIA chasing reject the connection. certbot has --preferred-chain for this; acme-tiny doesn't.

This PR adds the flag. It walks the alternate-link headers and returns the first chain whose issuer fields contain the given string, falling back to the default chain if nothing matches — fully backwards-compatible.

acme-tiny ... --preferred-chain "ISRG Root X1" > signed_chain.crt

Verified on a live YR2 domain: chain goes from 2 to 3 certs with the flag set. Existing test suite passes unchanged. The line count increases from 200 to 212; I propose to relax test_module_linecount to <= 215.

Some CAs, including Let's Encrypt, offer multiple chains via
Link: rel="alternate" headers in the ACME certificate response.
The default chain for newer intermediates (YR2, E5, E6, R10, R11)
may omit cross-signed intermediates that constrained clients require.

Example: --preferred-chain "ISRG Root X1" selects the Let's Encrypt
chain that includes ISRG Root YR, fixing incomplete-chain errors on
clients without AIA support.
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