Last active
August 6, 2022 08:29
-
-
Save mrrooijen/8ac6293cc4640a71fed3d92bfc9c05d5 to your computer and use it in GitHub Desktop.
Script to acquire Let's Encrypt SSL certificate using DNS challenge against Cloudflare.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
email="[email protected]" | |
domains="example.com,*.example.com" | |
cloudflare_email="[email protected]" | |
cloudflare_api_key="me-api-key" | |
# END CONFIG | |
brew install certbot | |
$(brew --prefix certbot)/libexec/bin/pip install certbot-dns-cloudflare | |
echo "dns_cloudflare_email = $cloudflare_email" > cloudflare.ini | |
echo "dns_cloudflare_api_key = $cloudflare_api_key" >> cloudflare.ini | |
chmod 0600 cloudflare.ini | |
certbot certonly \ | |
-n \ | |
--agree-tos \ | |
--dns-cloudflare \ | |
--dns-cloudflare-credentials ./cloudflare.ini \ | |
--config-dir letsencrypt-config \ | |
--work-dir .letsencrypt \ | |
--logs-dir letsencrypt-log \ | |
-m $email \ | |
-d $domains |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment