We moved to a new server and we moved all our Certificates with it.
Now we have a domain name that already got Certificate (it’s new and don’t need to renew) in the folder “acme-v01.api.letsencrypt.org”.
But when we enter to the domain name on the new server Caddy force the server to give the domain a new Certificates under the folder: acme-v02.api.letsencrypt.org.
Yeah - the same update Caddy got wildcard support, it was because we moved over from the ACME API v1 to v2. This required new ACME accounts and a new storage structure, I understand, so the old versions of your certificates aren’t compatible with upgraded versions of Caddy.
So all the domains will reload again for 10 seconds or more.
I have to say that this is something that need to be note somewhere when release a new version because it can make a downtime on some systems.
Anyway, thanks for the answer, I think I will need to go back to the old version.
It was noted near the top of the page in the blog post I linked, which was also noted and linked to in the Github releases page. Upgrading server software to a newer version without reading release notes is naturally a downtime inducing event!
I can’t recommend avoiding updates, though - bugfixes, security updates, features, etc etc etc - but that’s your choice to make as a server admin.
There are methods you can use to mitigate the delay in acquiring a large number of certificates via the new API, if that’s a critical issue.
Hi Matt, the problem is not with the upgrade.
We have more then 10K domains on our servers and if we move to version 10.12 Caddy will start getting new certificates for every domain.
This process is very slow (5-10 seconds) and sometimes is not 100% working and we need to wait for the next call of this domain name (5m and more sometimes).
So some of our domains will not be live until they will get the new certificate and it’s a real issue.
I think the way to solve it is:
If the domain have certificate under v01 Caddy need to use it.
If it’s a new domain Caddy need to use v02.
When a v01 domain need to be renew Caddy will renew it under v02. So 3 months after the upgrade everything will be v02 without any downtime.
I see… hmm, yeah, if there is an error getting certificates, that could slow you down. Are you using on-demand TLS? If so, it won’t happen at upgrade-time. I don’t recommend using that unless you need to, though.
I must use “on-demand TLS” because I don’t control all domains DNS.
Anyway this issue is really prevent us from upgrade and move to another server, I still think this is something that Caddy most think of that next time.
Anyway, I think on a solution and it will be great if you help me understand if it will work. This is what I want to do:
I’d previously operated under the assumption that the certs and keys themselves wouldn’t be portable, but looking at one of my instances that was around during the v2 update, they look the same (including folder structure).
The only difference appears to be the .json file. With ACME v1, the contents are:
It would be incorrect to adapt the JSON because it is describing the existing certificate. I don’t know whether that will impede the certs’ usage if you simply rename the containing folder to acme-v02.api.letsencrypt.org, but if not, I expect Caddy will work as you’ve proposed. It deserves some testing.
Something should be done about the acme-v02.api.letsencrypt.org/users folder, though; the new endpoint requires a new user registration. Possibly deleting this folder and having Caddy recreate it will suffice.
You know, you may be right that their metadata files are (somewhat) compatible. The certs/keys definitely should be, I just wasn’t sure and hadn’t tested migrating them, so you might be able to with some minor changes. However, you will definitely need a new user account – that won’t transfer.
Again, I’m not sure whether you can just change v01 to v02 in the Url fields and have it work. Would be worth testing.