Repository navigation
autohttps: Ensure CertMagic config is recreated after autohttps runs - #7510
Merged
Merged
Conversation
mholt
approved these changes
Mar 3, 2026
mholt
left a comment
Member
There was a problem hiding this comment.
Thanks Francis.
Man, the auto-HTTPS stuff feels more and more hacky as the years go on. I wonder if I need to sit down and rethink this at some point. Like it seems like we have to do quite a few things a second time, or there's lots of circularity in the code. Anyway, that's a topic for another time.
4 tasks
steadytao
pushed a commit
that referenced
this pull request
Oct 28, 2026
* caddytls: keep ACME issuer network proxy across re-provisioning LoadModule clears NetworkProxyRaw, so when the HTTP app provisions an ACME issuer a second time (fillInACMEIssuer), the rebuilt template has no HTTPProxy. Since #7510 that template is used via SetConfig, and ACME requests bypass the configured proxy. Keep the loaded proxy func on the issuer, like the DNS solver. Fixes #8283 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 2366825f2380383dacd8adeb1508e34c3e25634d) * caddytls: test that ACME requests use the proxy after RebuildCertMagic Replace the provision-twice check with a regression for the path the HTTP app takes: Provision, re-provision in fillInACMEIssuer, then RebuildCertMagic. The test issues against a local proxy and asserts the ACME request goes through it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: k4lleanka <257361691+k4lleanka@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Context: https://caddy.community/t/80-bind-error-when-starting-with-tls-internal/33491
Auto-HTTPS was setting the port "too late" after the issuer was provisioned so the CertMagic config was already created with the wrong
AltHTTPPort. This way, it will reconfigure CertMagic afterwards to ensure it's all good.Assistance Disclosure
Used a long session with Github Copilot to figure out what was going wrong, used it to apply the fix then I polished it and tested it by hand.