Skip to content

acme.sh

Issue

acme.sh --issue --standalone -d web.example.com \
    --server https://ca.example.com:8443/acme/directory \
    --ca-bundle /path/to/root.crt

With a web server already on port 80, use --webroot /var/www/html instead of --standalone. For tls-alpn-01, --alpn.

Renew and revoke

acme.sh keeps ECDSA certificates apart, so name them with --ecc:

acme.sh --renew -d web.example.com --ecc --force
acme.sh --revoke -d web.example.com --ecc

--force renews now, whatever the date. acme.sh remembers the CA and --ca-bundle from --issue.

Wildcards with dns-01

acme.sh has plugins for many DNS providers, e.g. dns_nsupdate for an RFC 2136 server:

export NSUPDATE_SERVER=10.0.0.53 NSUPDATE_KEY=/etc/acme/nsupdate.key
acme.sh --issue --dns dns_nsupdate -d '*.example.com' \
    --server https://ca.example.com:8443/acme/directory \
    --ca-bundle /path/to/root.crt

Install the certificate

acme.sh --install-cert -d web.example.com \
    --key-file /etc/nginx/tls/web.key \
    --fullchain-file /etc/nginx/tls/web.crt \
    --reloadcmd "systemctl reload nginx"

acme.sh installs a cron job that renews by itself. That job runs once a day and acme.sh counts renewal in days, which is too coarse for BastionXP CA's 24-hour certificates. Give acme.sh's certificates a longer-lived profile with acme.x509.cert_profile; see Renewal with 24-hour certificates.

Tested

BastionXP CA's end-to-end tests run acme.sh 3.1.6 against the CA on every change: --issue --standalone, --renew (naming the certificate it replaces) and --revoke. --standalone needs socat on the machine.