Skip to content

Instantly share code, notes, and snippets.

@RickyCook
Created July 7, 2026 15:56
Show Gist options
  • Select an option

  • Save RickyCook/46a862738d338623dfdfd8327621f05c to your computer and use it in GitHub Desktop.

Select an option

Save RickyCook/46a862738d338623dfdfd8327621f05c to your computer and use it in GitHub Desktop.
Constrained local root CA for Caddy
[ v3_ca ]
basicConstraints = critical, CA:true
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
# This restricts the CA to ONLY sign domains ending in .lan or .local
nameConstraints = critical, permitted;DNS:.lan, permitted;DNS:.local
{
pki {
ca local {
name "My Constrained Local CA"
root {
cert /etc/caddy/certs/root.crt
key /etc/caddy/certs/root.key
}
intermediate {
cert /etc/caddy/certs/intermediate.crt
key /etc/caddy/certs/intermediate.key
}
}
}
}
# Your local site blocks will now use this constrained issuer automatically
app.lan {
tls internal
reverse_proxy 192.168.25:8080
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment