Caddy¶
Caddy gets and renews certificates by itself. Define BastionXP CA once, as a snippet, and import it in every site:
Caddyfile
(bastionxp-ca) {
tls {
ca https://ca.example.com:8443/acme/directory
ca_root /etc/caddy/bastionxp-ca-root.crt
}
}
web.corp.internal {
import bastionxp-ca
root * /var/www/html
file_server
}
cais the directory;ca_rootthe CA's root, so Caddy trusts the CA's HTTPS certificate.- Set the CA per site, as above, not with the global
acme_caoption. When the ACME CA is set only in the global options, Caddy gives names ending in.internal,.local,.localhostor.home.arpa, and IP addresses, certificates from its own internal CA instead. The globalcert_issueroption behaves the same way. -
Caddy uses
http-01andtls-alpn-01; the CA must reach the host on port 80 or 443. To use only one, replacecaandca_rootwith an issuer block: -
Caddy reads the CA's renewal information and renews by itself; there is nothing to schedule.
Tested
BastionXP CA's end-to-end tests run Caddy v2.11.9 against the CA on
every change: a site set up with the snippet above, and one site each
with only http-01 and only tls-alpn-01. Each gets its certificate
and serves it.