Skip to content

Instantly share code, notes, and snippets.

@dahoba
Created April 30, 2021 12:27
Show Gist options
  • Save dahoba/50bec0966e4ec54e3cad52d9163bf680 to your computer and use it in GitHub Desktop.
Save dahoba/50bec0966e4ec54e3cad52d9163bf680 to your computer and use it in GitHub Desktop.
TLS request with acme.sh docker example
#! /usr/bin/env bash
set -e
# used cf information of api enabled domain name
# export CF_Key="<number>"
# export CF_Email="<email>"
export CF_Account_ID=<acccount-id>
export CF_Token="<api-token>"
# add cname record at target
#
# _acme-challenge.example.com
# => _acme-challenge.aliasDomainForValidationOnly.com
#
docker run --rm -it \
-e "CF_Account_ID=$CF_Account_ID" \
-e "CF_Token=$CF_Token" \
-v "$(pwd)/certs":/acme.sh \
--net=host \
neilpang/acme.sh --issue \
-d <tld; example.com> \
--challenge-alias <api-enabled.tld> --dns dns_cf \
-d <wild-card-tld; *.example.com> \
--log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment