httpcaddyfile: Inherit global ACME issuer settings in tls shortcuts#7617
httpcaddyfile: Inherit global ACME issuer settings in tls shortcuts#7617steadytao wants to merge 1 commit intocaddyserver:masterfrom
Conversation
|
Hmmm. I think this does make sense, but I worry that some users may be relying on this behaviour so it could be a breaking change. Also because we design config as one-way like |
|
This helped me think about the broader posture here and I think you’re right to be cautious. I was originally looking at it mainly from the reporter’s expectation that global That also lines up with the reporter’s follow-up concern, even if the PR made the original Caddyfile path behave the way they expected it would not affect already-adapted JSON/autosave so it doesn’t really settle the broader composition semantics. At this point I’m leaning away from the current broad merge approach. The safer direction is probably to avoid implicitly propagating module-specific |
That's not a valid concern, no users adapt to JSON then upgrade Caddy then load JSON config. Users use |
|
That’s a fair point and I think I framed that part too loosely. I don’t think the already-adapted JSON/autosave angle is really the right compatibility concern here. The more relevant concern is that users running a Caddyfile will have it adapted by the new version so this would silently change the meaning of existing configs that combine global Does that sound like the right way to think about the compatibility risk here? If so, I’m wondering whether the better direction is to keep the current semantics and instead either document the boundary more clearly or warn on that combination rather than trying to make the adapter implicitly compose them? |
|
@francislavoie Tbh I do feel like I would expect this to disable the challenge for ALL sites. Usually if it's disabled, it's because there's not a route for TLS to get from the "outside" to the current process or machine. I don't know if I ever see it disabled on a per-site basis. |
Fixes implicit ACME issuer construction for
tlsshortcut directives such asca,ca_root, anddnswhen a globalcert_issuer acme { ... }is also configured.Before this change, the
tlsshortcuts built a fresh site-local ACME issuer and replaced the base/global issuers for that automation policy. That meant ACME-specific settings configured globally throughcert_issuer acmesuch asdisable_tlsalpn_challengewere not carried over to the subject-specific issuer actually used for issuance or renewal.This change makes implicit ACME issuers inherit from any globally-configured ACME issuer templates then applies the local shortcut settings as overrides. This preserves global ACME issuer behavior while still allowing per-site shortcut customization such as overriding the CA directory or trusted roots.
Notably, this fixes the
#7612case where:cert_issuer acme { disable_tlsalpn_challenge }was configuredtls { ca ... ca_root ... }This fix is not specific to TLS-ALPN. It preserves nested ACME challenge settings generically for implicit issuer construction.
Tests added:
cert_issuer+ localca/ca_rootcomposition shape from#7612Fixes #7612.
Assistance Disclosure
No AI was used.