Docs › Certificates
Wildcard certificates with Caddy
Needs a Caddy build including the acmedns DNS module. Either pick the module on the Caddy download page, or build locally with xcaddy build --with github.com/caddy-dns/acmedns.
Where the configuration lives
Caddyfile
Configuration
*.alice.home.network, alice.home.network {
tls {
dns acmedns {
username "<your username>"
password "<your key>"
subdomain "<your subdomain>"
server_url "https://api.home.network/acmedns"
}
}
reverse_proxy localhost:8080
}The username, password and subdomain come from the setup wizard, which shows them once. They are stored hashed, so a lost set is replaced rather than recovered.
Ask for both names
A wildcard does not cover the name it sits under, so a certificate for *.alice.home.network alone leaves alice.home.network without one. Request both in a single certificate.
Check it worked
# the challenge value your client published
dig +short TXT _acme-challenge.alice.home.network @ns1.home.network
# what the certificate ended up covering
echo | openssl s_client -servername nas.alice.home.network \
-connect nas.alice.home.network:443 2>/dev/null \
| openssl x509 -noout -text | grep -A1 "Subject Alternative Name"Why only wildcards
Challenge records are writable only at your label apex, so the only certificates obtainable are the wildcard and the label itself. Your individual device names never reach Certificate Transparency logs, which is a consequence of the design rather than a setting to remember.