Auto Renew Let’s Encrypt Certificates

I’m a big fan of Let’s Encrypt (free, widely trusted SSL certificates) but not a big fan of most of the client software available for requesting and renewing certificates. Unlike a typical certificate authority, Let’s Encrypt doesn’t have a webui for requesting/renewing certs; everything is driven via an automated process that is run between a Let’s Encrypt software client and the Let’s Encrypt web service.

Since the protocols that Let’s Encrypt uses are standards-based, there are many open source clients available. Being security conscious, I have a few concerns with most of the clients:

  • Complication. Many of the clients are hundreds of lines long and unnecessarily complicated. This makes the code really hard to audit and since this code is playing with my crypto key material, I do want to audit it.
  • Elevated privilege. At least one of the clients I saw required root permission. That’s a non starter.

I can’t remember how, but I discovered a very clean, very simple client called acme-tiny at This script was obviously written by someone who shares the same concerns as I do and I highly recommend it to others.

I used acme-tiny to request my initial certificates — and it worked very well for that — but I didn’t quite like how renewals worked. Since acme-tiny works on a single domain at a time, I would have to create multiple crontab entries to cover all of my domains. I also didn’t want to manage my list of domains that needed renewal in a crontab.

In keeping with my security concerns, I wrote a simple, non-privileged shell script which wraps acme-tiny and makes renewals simple and automatic. The script as well as detailed instructions are here:

An example of the script run:

le@server% cat /etc/ssl/lets_encrypt_domains.txt

le@server% ls -l /etc/ssl/
-rw-rw-r--  1 root  le  0 Mar  8 08:51 /etc/ssl/

le@server% ./
+++ Renewing
Parsing account key...
Parsing CSR...
Registering account...
Already registered!
Verifying verified!
Verifying verified!
Signing certificate...
Certificate signed!

+++ Installing certificate for
Checking validity... Valid certificate file.
Installed updated certificate bundle as /etc/ssl/

Go encrypt!

Leave a Reply

Your email address will not be published. Required fields are marked *

Would you like to subscribe to email notification of new comments? You can also subscribe without commenting.