Skip to content

Instantly share code, notes, and snippets.

@zengxs
Created February 1, 2021 03:53
Show Gist options
  • Save zengxs/e1b7fcb73a9b6bbcb025f2bdb0892276 to your computer and use it in GitHub Desktop.
Save zengxs/e1b7fcb73a9b6bbcb025f2bdb0892276 to your computer and use it in GitHub Desktop.
SSL certificates renew script for ZeroSSL using lego.
#!/bin/sh
export CLOUDFLARE_EMAIL='[REDACT: your cloudflare email]'
export CLOUDFLARE_API_KEY='[REDACT: your cloudflare api key]'
lego \
--server https://acme.zerossl.com/v2/DV90 \
--accept-tos \
--path /srv/lego \
--eab \
--kid '[REDACT:KQ******************iQ]' \
--hmac '[REDACT:gfdhdsJE**********************************************************************jZOlTo7w]' \
--email '[REDACT:your email]' \
-d '[REDACT:your domain, eg: example.com or *.example.com]' \
-d '[REDACT:your another domain]' \
--key-type rsa2048 \
--dns cloudflare \
renew \
--must-staple \
--reuse-key \
--days 45 \
--renew-hook 'sudo nginx -s reload'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment