Let’s Encrypt / certbot in 2024
I was an early adopter for Let’s Encrypt, back in 2016, then renewed in 2019. Over time I’ve accumulated a lot of cruft in my main web server related to it. To the certbot team’s credit it’s worked all this time with minimal intervention. I was adding a new virtual host domain name and needed to update the certificate, so I looked at it for the first time in a few years.
I was running certbot 1.10 or something; certbot 2.9 is current. So I used apt to remove the certbot packages I’d installed long ago from a PPA. And followed the new instructions to install from snap. This installs an executable in /snap/bin/certbot. It also installs a systemd timer to renew certificates that you can see with systemctl show snap.certbot.renew.timer.
I think I still have some old cruft lying around. /etc/letsencrypt was never purged so the new Snap picked that up, which is a missed blessing. I also have a /etc/cron.d/certbot which will renew, but only if systemd isn’t installed. So I’m just leaving that assuming it’s harmless.
Anyway, certbot reinstalled it’s time to reconfigure certificates. This is as simple as running certbot and accepting the defaults. It generates a single SSL certificate to be used for all the domain names it finds in your Apache configs. It creates Apache2 site config files named *-le-ssl.conf to reference the SSL certificate. Certbot also prompted me to switch from RSA to ECDSA keys. Sure, why not.
Renewal can be tested with certbot renew --dry-run. It seems to process all the files it finds in /etc/letsencrypt/renewal. I have an old one left behind from December for windhistory.com, which I think is no longer used so I removed it. My new one it has chosen to name for logsoflag.com, probably a name it picked years ago. It seems to be used for all my domains.
Another mild naming nuisance: the SSL certificate has Common Name (CN) feditrends.com. That’s one of my 9 domain names. Apparently certbot just picks the first name in an alphabetical list when making a cert for multiple domain names. You can override it but it’s a nuisance, so I’m just going to ignore it.
It all seems to work and honestly took less time to run than to verify what it was doing and write up these notes. I’ve made a reminder on my calendar to check in May a few days before expiration that the renewal worked automatically.