ACME v2, wildcard certificates, and Cloudflare DNS

Now that ACME v2 is released and supports wildcard certificates I just had to update my configuration and thought I would share it here.

I also took the opportunity to switch to a dns-01 based verification since its easier to maintain and there is no need expose a webserver/www-root to the internet. I currently host my domain with Cloudflare, and since has built in support for the Cloudflare API it was an easy choice.

This makes it very easy to automate and since its dns based it can run anywhere, even on your raspberry pi running in a closet at home if wanted (thought not recommended for obvious reasons).

Thought I would share my final solution, running, nginx and systemd:


Description=Renew Let's Encrypt certificates using

# Directory where the script resides.
ExecStart=/root/ --issue --dns dns_cf -d -d * --keylength ec-256 --key-file /etc/nginx/ssl/ --fullchain-file /etc/nginx/ssl/ --reloadcmd "systemctl force-reload nginx"
# returns 2 when renewal is skipped (i.e. certs up to date)
SuccessExitStatus=0 2


Description=Daily renewal of Let's Encrypt's certificates



test that the service works and enable timer:

systemctl daemon-reload
systemctl start acme_letsencrypt --now
systemctl enable acme_letsencrypt.timer

and thats it, I can now leave it and add all the subdomains I want in nginx without the need to reconfigure anything ever again.