Skip to content

Instantly share code, notes, and snippets.

@cpsubrian
Last active November 22, 2016 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cpsubrian/d8c84267e66cfbce2e92fda1df35db36 to your computer and use it in GitHub Desktop.
Save cpsubrian/d8c84267e66cfbce2e92fda1df35db36 to your computer and use it in GitHub Desktop.
LetsEncrypt Auto Renewal Via Dgate

Note: You must edit [domain] and [dir] in the examples below.

Step 1. Double-check that dgate-ssl is loading the live certs.

Step 2. Create a script to renew the cert via an http standalone server. (Make sure it has execute permissions)

~/certbot-auto certonly\
  --standalone\
  --standalone-supported-challenges http-01\
  --http-01-port 3005\
  --email dev@terraeclipse\
  --domains [domain]\
  --agree-tos\
  --non-interactive

Step 3. Edit /etc/hosts and add an entry for the renewal endpoint.

#dgate port=3005&https=true&path=/.well-known/acme-challenge/*
127.0.0.1 [domain]

Step 4. Edit crontab sudo crontab -e and add the following task.

* 1 * * 1 /home/ubuntu/[dir]/bin/cert && service dgate-ssl restart

Step 5. Test the renewal by running the script and restarting dgate-ssl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment