-
-
Notifications
You must be signed in to change notification settings - Fork 296
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
CacheUnmanagedCertificatePEMBytes returns only the first certificate and omits intermediate and root certificates. What am I doing wrong? #308
Comments
Can you attach the full chain file here and I will see if I can reproduce it? |
@mholt there you go:
Thanks for looking into this! |
Thanks! I'm getting ready for a presentation next week but I'll try to revisit this soon |
Wait, does the file literally contain lines like If so, that's the problem. PEM files can only contain PEM blocks. |
@mholt I believe the FWIW, the certificates are stored without the comments -- so only PEM blocks. You can check an example here. The certificate chain seems to missing but if you visit the page through your browser you should see that the certificate is loading. But if you use a tool like |
Ok, thanks. Next question sounds stupid, but can you print and paste here the exact output of |
@mholt is there an alternative way to debug this? They're self-hosting Stormkit so I'd need to publish a version just with the debug 😅 |
Not without the exact code and inputs to it. Taking your PEM blocks above (without the extra lines as mentioned) and giving that as input to |
@mholt this is the output as you requested - right before calling
|
Ah, I guess to test this and reproduce the issue, I will need both a public key (certificate) and private key pair -- i.e. the private key associated with the cert. Can you post a test cert chain and private key that I can use to reproduce the issue? Don't send me your production private key, obviously. :) |
@mholt would https://www.ssl.com/certificates/free/buy/ work for you to generate a test certificate? This is where I'd generate the test certificate anyways. I think it's the easiest way and prevents back and forth. |
Well that's the thing, I can generate my own cert chain and everything works as expected. That's why I want to test with your specific cert chain you're having an issue with. |
@mholt I still have this in mind. Apologies that I couldn't reply lately, been busy with other things. I'll ping you once I have a test certificate set. |
What is your question?
I'm using
CacheUnmanagedCertificatePEMBytes
and manage custom TLS for several websites using the following code:Despite passing the
full certificate chain
to certmagic, the server returns only the first certificate and omits intermediary and root certificates.Browsers are handling this correctly because they retrieve the missing certificates, but when I use SSL tools, they also throw errors.
What have you already tried?
Include any other information or discussion.
Bonus: What do you use this package for, and does it help you?
I use this at stormkit.io to issue dynamic certificates for hosted apps. Self-hosted enterprise customers usually prefer to host their managed certificates so I have to use a combination between dynamic and managed certificates. It works pretty well, thanks for your work 🙏
The text was updated successfully, but these errors were encountered: