Skip to content

lego

lego trusts extra roots through LEGO_CA_CERTIFICATES.

Issue

sudo LEGO_CA_CERTIFICATES=/path/to/root.crt lego \
    --server https://ca.example.com:8443/acme/directory \
    --email [email protected] --accept-tos \
    --domains web.example.com --http run

--tls uses tls-alpn-01 instead of --http.

Wildcards with dns-01

lego supports many DNS providers, e.g. RFC 2136:

RFC2136_NAMESERVER=10.0.0.53 RFC2136_TSIG_KEY=acme RFC2136_TSIG_SECRET=... \
RFC2136_TSIG_ALGORITHM=hmac-sha256. \
LEGO_CA_CERTIFICATES=/path/to/root.crt lego \
    --server https://ca.example.com:8443/acme/directory \
    --email [email protected] --accept-tos \
    --domains '*.example.com' --dns rfc2136 run

Renew and revoke

Run lego renew every hour: BastionXP CA's certificates last 24 hours by default. With --days N (default 30), lego renews whenever fewer than N days are left, which for a 24-hour certificate is every run. lego renew first waits a random time; --no-random-sleep skips that.

sudo LEGO_CA_CERTIFICATES=/path/to/root.crt lego --server https://ca.example.com:8443/acme/directory \
    --email [email protected] --domains web.example.com --http renew
sudo LEGO_CA_CERTIFICATES=/path/to/root.crt lego --server https://ca.example.com:8443/acme/directory \
    --email [email protected] --domains web.example.com revoke

Certificates are in .lego/certificates/.

Tested

BastionXP CA's end-to-end tests run lego v4.35.2 against the CA on every change: run with --http, renew (with ACME Renewal Information, naming the certificate it replaces) and revoke.