-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling get_certificate should disable cert automation #5415
Comments
If we change the /test/Caddyfile in setp 4 with some existing file just like:
It makes no difference. I know manual says the response must have a 200 status code and the body must contain a PEM chain including the full certificate (with intermediates) as well as the private key. But there is no access_log in cert.mysite, which means cert.mysite didn't get the HTTP request from caddy. |
Thanks for the detailed issue! I suppose the expectation here is to not get certificates from the issuers because a certificate manager (get_ceritificate subdirective) is specified. But just to clarify, you did actually make an HTTPS request to |
My fault, I didn't understand the description about get_certificate . I tried to make a request to https://web.mysite from cert.mysite, and I got these logs from cert.mysite:
It works! Every time I make a request from cert.mysite to https://web.mysite, these logs are printed. The one last problem is: although HTTP is functional on web.mysite, caddy still keeps requesting for letsencrypt and zerossl. Thanks to your reply, I find the way to build a external cert manager for caddy now. |
Glad you were able to make progress. I'm currently addressing the "still requesting certs from CAs" issue -- I guess most users would expect, in the presence of a |
Thank you! Actually, I was trying to build something like issuer proxy for caddy. It has two benefit: 1. being able to setup SSL for caddy without internet. 2. No more dns token for every single server without public IP, dns token leaking is far more serious than certificate leaking. I thought I cloud create a certmgr to manage certificate, and let caddy pull SSL certificate from certmgr by get_certificate without internet access. Now I realized that by using get_certificate, caddy will request certificate for every single session, and caddy will not manage/cache certificate any more, because the build-in renew service is totally disabled. That makes sense because manual says "certificate manager modules implies that an external tool or service is keeping the certificate renewed". The goal is partly achieved, HTTPS server without internet could be setting up, but if certmgr is down, every downstream caddy server would be unable to initialized new sessions. |
You could solve that by running a caching proxy on the same machine as Caddy, or using something like like the
Or you could just implement your own module instead of |
Thank you! I think cache-handler will be good enough for most cases. |
I've been working on this the last few days... it's quite tricky / involved; I've started by making certificate manager config part of OnDemand config in CertMagic: caddyserver/certmagic@master...certmanager-refactor |
Awesome workaround. However, the ability to set a cache without this would be pretty cool though. Here is a quick php script that i put together that will work as a server_name query handler:
|
Actually, the loopback to the cache doesnt seem to work for me. I am not sure if its a configuration issue or something with my container. I may have to mess with that portion some more. |
@johnmmcgee I'm not super familiar with the cache module, but it could be that you need to set a header to make the response cacheable? (Not sure though.) |
i have a handler setup. i have: order cache before rewrite If i shell into the container and do a connection to localhost:4581, $LOCALIP:4581 or 127.0.0.1:4581 (my cache port) it works. however, caddy connecting to itself on port 4581 does not seem to work. EDIT: i read that as handler, not header.. either way, the cache DOES work when connecting to it outside of caddy connecting to itself. |
setting the label to: http://localhost:4581 fixed my issue. |
I set the get_certificate section in caddyfile, caddy verified all parameters and directly goes to HTTP-01 challenge.
here's my procedure to reproduce the issue:
one record of log is printed by cert.mysite
The text was updated successfully, but these errors were encountered: