-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
acme_server sometimes delivers outdated intermediate certificate when clients ask for certificate renewal #4517
Description
This is a reminder for the issue reported over there in the Caddy Community:
https://caddy.community/t/internal-ca-certificate-renewal-does-not-refresh-intermediate-cert-properly
Observed with Caddy version 2.4.6
Quoting @francislavoie for a summary of the observations:
Strange. So it sounds like the acme_server directive still had the old intermediate cert in memory when performing renewal? There might be missing a thing to reload the certs used by the ACME server when the intermediate is renewed. I’ll try to take a look at the code soon to see if anything stands out.
First feedback (by @francislavoie):
At a glance, it looks like the fix would be a bit complicated because of how the actual CA renewal process and the ACME server are decoupled. I have some work in progress to implement an event system in Caddy, and the event system would make this much easier to resolve (i.e. CA intermediate cert renewal would trigger an event, the ACME server could subscribe to that event and update the intermediate cert at that point).
The other option is we could add a timer inside the ACME server to reload the intermediate cert from storage daily-ish which might be good enough.
As a workaround, force reloading Caddy every once in a while might help (as suggested by @francislavoie):
Alright well as a workaround I recommend force reloading Caddy at least once a week (daily even better) for the time being so that it has a chance to refresh the intermediate cert in memory before the ACME server tries to issue certs. You can do this with docker-compose exec -w /etc/caddy caddy caddy reload --force I think. You can put this in a cron job or something.