-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Caddy fails to obtain a fresh certificate except if the ssl/acme/users folder is deleted and Caddy reloaded. #2451
Comments
Looks like a rights issue in your install sequence. What was your full install script? Did you include commands like these?
|
I'm doubtful about a permission issue, as it's working well with 0.11.0 and below with the exact same setup, and what makes it working is deleting the |
I will be submitting a PR soon I'd like you to try, to test that it fixes the problem -- please make sure that the issue is still replicable until then. Thanks! |
Sure, thank you! |
If you could, please build Caddy using the fix-sni branch and help test the PR #2452. Report back ASAP and let's get this fixed. |
Hello, Built Caddy based on 40ba973, but when tried to obtain a new certificate:
Build attached. |
@fr33tux What is your exact Caddyfile? (I can't reproduce it by guessing, which I've already tried, and it works.) EDIT: Okay it only happens on SIGUSR1 apparently |
It only contains a serie of vhosts like this one, with the only change between them being the log paths and the proxy port:
I haven't tried by restarted Caddy with the latest build indeed. Do you need that? |
@fr33tux Thanks for the quick report! I was able to repro the bug and I've pushed a fix. Please try again, thanks! |
I confirm it fixes the issue (or at least my part, can't say for the others as I don't reproduce their):
Thank you for the quick fix! |
Okay excellent. Thank you for the fast response! |
#2452) * caddytls: Fix empty SNI handling (new -default-sni flag) vendor: update certmagic, needed to support this Hopefully fixes #2451, fixes #2438, and fixes #2414 * caddytls: Don't overwrite certmagic Manager (fixes #2407) Supersedes #2447 * vendor: Update certmagic to fix nil pointer deref and TLS-ALPN cleanup * Improve -default-sni flag help text
I am seeing this on version 0.11.5 from a Windows 10 machine. Was this fix added to 0.11.5? |
If I may, I think I see several minor issues here that when using -service install should be addressed to make it easier for faster deployment. When using the hook.service, caddy -service install should do the following to fix several issues at once:
This are just a couple of things that would help in deployment. |
Hello,
1. What version of Caddy are you using (
caddy -version
)?Caddy 0.11.2 (+8369a121) (unofficial)
go version go1.11.4 linux/amd64
Compiled and ran on Ubuntu 18.10.
2. What are you trying to do?
I'm trying to get a certificate for a new domain by adding the domain configuration and reloading Caddy.
3. What is your entire Caddyfile?
It's composed of 10 snippets like this one below. The two differences between them are the proxy port and the log paths.
tls.conf:
4. How did you run Caddy (give the full command and describe the execution environment)?
Using the systemd unit file provided. ExecStart:
/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/var/tmp
5. Please paste any relevant HTTP request(s) here.
n/a
6. What did you expect to see?
journalctl -f -u caddy.service
should log that the certificate for the new domain has been successfully obtained. Instead, it logs the following errors.ssl
folder that Caddy uses to store its certificates, and reload Caddy, then it successfully obtains the already configured and the new certificate(s). It just can't obtain new certificates. I haven't tested the renewal.ssl/acme/users
subfolder and reload Caddy, then the new certificate(s) are successfully obtained too.Note that I'm seeing the error
TLS handshake error from 66.133.109.36:60828: all certificates configured via GetConfigForClient
from numerous IP addresses (and not only LE during certificate obtention like this one) since 0.11.1. This wasn't happening before.7. What did you see instead (give full error messages and/or log)?
8. How can someone who is starting from scratch reproduce the bug as minimally as possible?
It may somehow be related to #2400, but the behavior is the same before and after the published fix for it, and the behavior I observe is slightly different too.
I'm attaching the caddy build I'm using if it helps (plugins are used in this build, but this behavior happens with and without plugins).
caddy.zip
I'll be happy to help if you need further details. Thanks!
The text was updated successfully, but these errors were encountered: