Is there anyway to have Caddy generate a self signed certificate and store it in the normal area? ~/.caddy. This would really help as we could make the certificates persistent throughout different machines and builds. What I mean by this is that if I use Caddy inside of a docker container, every time I restart that container a new self signed certificate is generated, thus I have to add that new certificate to be trusted by my local browser. Instead, if we were able to persist certificates in the same way that real certs are persisted, then we would only need to trust one self signed cert, and all members of a development team could also just trust that same cert.
Sorry for the wall of text! If there is someway I could help with this I can definitely try. Let me know what you think! :)
Map ~/.caddy to a directory on the host.
@abiosoft I tried that but wasn't getting a certificate for some reason. I tried exec'ing into the container and searching for a cert in ~/.caddy and couldn't find one.
The self-signed certs are kept in memory only; they're not written to disk.
I guess we _could_ flush them but I didn't intend for Caddy to become a certificate generation tool really; at the point of wanting to reuse a dev certificate you might as well just run openssl then bring your own cert (tls cert.pem key.pem kind of thing).
Also, you can tell Chrome to ignore cert warnings on localhost. chrome://flags/#allow-insecure-localhost :+1: I'll recommend that route for now.
@mholt Perfect! Didn't find that option in my googling haha. Thanks!! :)
well keeping the dev cert and making it trusted makes any browser shut up about it. and to be honest it's easier to use caddy to let the certs be made than to do it with openssl.
Most helpful comment
Also, you can tell Chrome to ignore cert warnings on localhost. chrome://flags/#allow-insecure-localhost :+1: I'll recommend that route for now.