Hi everyone. I’m deploying CFSSL CA Server integrated with Caddy but I can’t find any Caddy config or plugin that support CFSSL.
Here’s is my stack workflows:
Caddy’s ACME server continues to receive certificate requests from Caddy clients.
Caddy’s ACME server forwards the requested certificates to CFSSL, based on the profile you specify.
CFSSL will sign the certificate according to the corresponding profile and then return the certificate to Caddy’s ACME server to provide to the client.
Hi Mr. Francislavoie,
Is there another way to use Caddy to get certificate automatically from CFSSL?
example:
In Caddy Instance for my custom app, I config like this:
myapp.local {
tls {
domain myapp.local
cert_type server
profile long
}
}
Then that Caddy Instance will request to the Caddy server infront CFSSL with this:
curl -X POST -H "User-Agent: CFSSL-Server" -d '{"request":{"hosts":["myapp.local"]},"profile":"long","bundle":true}' http://cfssl-server/private/api/v1/cfssl/newcert
Then the Caddy server in front of CFSSL will forward the request to CFSSL and CFSSL will handle the request and issue the cert, then send back to the Caddy Instance for my app.
Is there any reason you can’t use Caddy’s CA (aka smallstep) that’s already built-in? Why do you think you need CFSSL specifically?
How did you come up with this? That doesn’t look anything like valid Caddyfile config. There’s no such thing as domain, profile and domain options for Caddy’s tls directive.
Yeah, I know this is not Caddy config. It’s just for example.
I want to use CFSSL because my organization use Private DNS with Private Local Domain Name so I can only use self sign with custom Root CA.
I can’t not use other CA like Letsencrypt though.
You can do that with Caddy/smallstep too. See Global options (Caddyfile) — Caddy Documentation, you can load in your own root CA cert/key if you want, or let Caddy generate one to use as your root and install it on your various internal clients.
Hi Mr. Francislavoie, is it possible for Onestep-ca (the one that you said it was built-in with Caddy) automatically create certificate and apply to Caddy with custom profile?
Example:
Assump that I have configure Onestep-ca with 3 profile certificate (long: 90days, medium: 60 days, short: 30 days).
Now I just have to config TLS in Caddy like: tls { myapp.com short } (assumption)
and then Caddy will automatically get a certificate with short profile from Onestep-ca. Is that possible?
Why do you need “profiles”? The default lifetime should be fine. See tls (Caddyfile directive) — Caddy Documentation, you just configure tls internal and Caddy will issue certs using its internal issuer (Smallstep). The default lifetime of the leaf certs is 12h. You grab Caddy’s root cert from its storage, which has iirc a 10 year lifetime, and install it on your various machines to establish trust. That’s it. The rest is automated.
I’ve managed to make it work by adding one more webhook server. When I define tls { get_certificate http http://my-webhook.server/cfssl_api }, it works.
Thanks very much for your support!