-
-
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
Problem with the way Caddy serves multiple certificates #2334
Comments
Related to #1303 👍 |
with regard to #1303 does the following work if you specify :443 at the end of your domains to force https?
Also please fill in all the questions on the issue sheet. You have left question 5 blank but it is hugely relevant in this instance. How are you requesting the domain? If this fixes your issue I will explain with reference to #1303 what is happening. |
@tobya No, specifying :443 at the end of the domains sadly didn't fix my issue. The certificate still changes each time I run the shell script. As for question 5, I'm not sure where I can get the HTTP request from. I'm using openssl to request the certificate from the domain (see shell script), so I'm not seeing the actual HTTP request in the terminal. |
Can you specify how you are calling your shell script. Can you use an actual call. |
Just for future reference: The reason why the fetched certificate changed each time is because I wasn't telling OpenSSL to use SNI. The following shell script can be used to fetch the correct certificate each time:
|
@tobya I can confirm that OpenSSL now returns a TLS alert instead of a random certificate when attempting to fetch the certificate without using SNI. |
1. What version of Caddy are you using (
caddy -version
)?Caddy 0.11.0 (+22dfb14 Sun Nov 04 19:32:32 UTC 2018) (unofficial)
2. What are you trying to do?
I'm trying to fetch a certificate from my domain app01.domain.tld by using the following shell script.
3. What is your entire Caddyfile?
4. How did you run Caddy (give the full command and describe the execution environment)?
I'm running Caddy on Debian 9.5 (stretch).
5. Please paste any relevant HTTP request(s) here.
N/A
6. What did you expect to see?
The certificate of app01.domain.tld.
7. What did you see instead (give full error messages and/or log)?
The certificate of either app01, app02 or app03.domain.tld. The certificate changes each time you run the shell script.
8. How can someone who is starting from scratch reproduce the bug as minimally as possible?
This issue does not affect sites which are not served with Caddy. To verify this, run the same shell script on such a domain and observe that the certificate in the output is the same every time you run it and that it is the correct one for the domain.
The practical relevance of this problem is that the remote control software MeshCentral cannot fetch the correct certificate from a subdomain that is served with Caddy because it receives a different certificate each time it tries to fetch it.
The text was updated successfully, but these errors were encountered: