caddyserver/certmagic

CacheUnmanagedCertificatePEMBytes returns only the first certificate and omits intermediate and root certificates. What am I doing wrong?

Opened this issue · 13 comments

What is your question?

I'm using CacheUnmanagedCertificatePEMBytes and manage custom TLS for several websites using the following code:

cnf := certmagic.NewDefault() 
cnf.CacheUnmanagedCertificatePEMBytes(
  context.Background(),
  []byte(appConfig.CertValue),
  []byte(appConfig.CertKey),
  nil,
)

// I also manage `on-demand` certificates on the same 
// server for applications that do not define a custom certificate:
certmagic.Default.OnDemand = &certmagic.OnDemandConfig{
  DecisionFunc: myDecisionFunc(),
}

// and finally spin up the server using `HTTPS` method:
certmagic.HTTPS(/* ... */)

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 🙏

Can you attach the full chain file here and I will see if I can reproduce it?

@mholt there you go:

subject=CN = learn.haj.gov.sa

issuer=C = US, ST = Texas, L = Houston, O = SSL Corporation, CN = SSL.com RSA SSL subCA

-----BEGIN CERTIFICATE-----
MIIHDjCCBPagAwIBAgIQPstk5XlT2Hmq1k/pat3iwzANBgkqhkiG9w0BAQsFADBp
MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24x
GDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjEeMBwGA1UEAwwVU1NMLmNvbSBSU0Eg
U1NMIHN1YkNBMB4XDTI0MDkwNTEwMzgzNFoXDTI1MDczMTEwMzgzNFowGzEZMBcG
A1UEAwwQbGVhcm4uaGFqLmdvdi5zYTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
AQoCggEBAJcPIe7BEFEehFLzILVd/46RUPGqTWsKk09olDVG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J2Ciysu8gqAAABkcHM45YAAAQDAEYwRAIgJd2px98uKBGEvIZN
K3jTOwhJNEog0ZoybnG0XGn5FVcCICylh7nrUHOVT4dGeOxuVhejBWERo44N8h6n
ofGfZv3TAHYAEvFONL1TckyEBhnDjz96E/jntWKHiJxtMAWE6+WGJjoAAAGRwczj
dQAABAMARzBFAiEAlsAEcr3ojgpnpRa5Hx2bOB+F0O8zzUwbeFB12YKCzxACIDjx
JJZovXrkBVOCGvLbi8RBcCrcQCJlbaym1ZBXXeSrMA0GCSqGSIb3DQEBCwUAA4IC
AQBHy/GED47Bbgbuaq+oqYrp1y05QgjRx+nrV8N2bWo9bk8TS1/Bhjph7SrRgYDg
FVRReikBD7EvGd7Oj4osNUpnnn21Njv6snT1xYcpoKGZ2vGmIvqM5Bu46VHrszYT
GPKOt6dU/j4z2BwTffFZssUNiLibAmnDePN39Xns7F8znbQ3meDdwwaT2skqLd8Z
6GQrHAEBP2S90UbT+uWoDykXX2A9taaw+fFXdg3nl6Jx4trJP2oqunrAwCt8ogK0
aiotmm9bnJ8H7mUnip0QqQBAi32p55I0aLUmRue3Y9vc+wCnS7okyftaNGEBfSCo
+bHwRxoSY0S1zGy/BicjKvbMG/7ddZ6aSKPTXCiUsOoPAOeDfB3kVXZ1YTckoHq/
8ukSht2G1eSTOgXnRDXM9N2e9dofNabT8WLpcbV1bbeJ8JUQTnK+kP6r+d575pMv
8gfXZVdUqNCNrIJK0LeaGx4EwAJUFa80rhytE2wqIxO/L5Re3JeoyZoAWgxDynnB
z+l1ybdTL0JsEsei0+UVH6/VWDgRTwwavusiebh4JW5f/lRcFdMJkkXR8o7HeHIR
3z2puzTDSPJNFh8tQgRechKLrhoEKE5O6Ro96NA+9Lw7ztW/kqyqBnsxCqxMHjiq
uEE+i3QuNVFP9v8RCeEf3a50sEDyJPZzbDaHRMuP56Aliw==
-----END CERTIFICATE-----

subject=C = US, ST = Texas, L = Houston, O = SSL Corporation, CN = SSL.com RSA SSL subCA

issuer=C = US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VU1JCVC7sAtkdki
vnN1/6jEKFJvlUr5/FX04JXeomIjXTI8ciruZ6HIkbtJup1n9Zxvmr9JQcFTsP2c
bRbjaT7JD6MBidAWRCJWClR/5etTZwWwWrRCrzvIHC7WO6rCzwu69a+l7ofCKlWs
y702dmPTKEdEfwhgLx0LxJr/Aw==
-----END CERTIFICATE-----

subject=C = US, ST = Texas, L = Houston, O = SSL Corporation, CN = SSL.com Root Certification Authority RSA

issuer=C = US, ST = Texas, L = Houston, O = SSL Corporation, CN = SSL.com Root Certification Authority RSA

-----BEGIN CERTIFICATE-----
MIIF3TCCA8WgAwIBAgIIeyyb0xaAMpkwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UE
BhMCVVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQK
DA9TU0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZp
Y2F0aW9uIEF1dGhvcml0eSBSU0EwHhcNMTYwMjEyMTczOTM5WhcNNDEwMjEyMTcz
OTM5WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hv
dXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNv
bSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFJTQTCCAiIwDQYJKoZIhvcN
AQEBBQADggIPADCCAgoCggIBAPkP3aMrfcvQKv7sZ4Wm5y4bunfh4/WvpOz6Sl2R
xFdHaxh3a3by/ZPkPQ/CFp4LZsNWlJ4Xg4XOVu/yFv0AYvUiCVToZRdOQbngT0aX
qhvIuG5iXmmxX9sqAn78bMrzQdjt0Oj8P2FI7bADFB0QDksZ4LtO7IZl/zbzXmcC
C52GVWH9ejjt/uIZALdvoVBidXQ8oPrIJZK0bnoix/geoeOy3ZExqysdBP+lSgQ3
6YWkMyv94tZVNHwZpEpox7Ko07fKoZO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Xz1PQ/Y
K9f1JmzJBjSWFupwWRoyeXkLtoh/D1JIPb9s2KJELtFOt3JY04kTlf5Eq/jXixtu
nLwsoFvVagCvXzfh1foQC5ichucmj87w7G6KVwuA406ywKBjYZC6VWg3dGq2ktuf
oYYitmUnDuy2n0Jg5GfCtdpBC8TTi2EbvPofkSvXRAdeuims2cXp71NIWuuA8ShY
Ic2wBlX7Jz9TkHCpBB5XJ7k=
-----END CERTIFICATE-----


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 subject=C = US, ST = Texas, L = Houston, O = SSL Corporation, CN = SSL.com Root Certification Authority RSA ?

If so, that's the problem. PEM files can only contain PEM blocks.

@mholt I believe the tls package handles them because it was working with these as well.

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 curl, the handshake will fail because the certificate is unknown.

Ok, thanks. Next question sounds stupid, but can you print and paste here the exact output of appConfig.CertValue from the code above? log.Println(string(appConfig.CertValue)) in the line immediately before the Cache call should suffice.

Ok, thanks. Next question sounds stupid, but can you print and paste here the exact output of appConfig.CertValue from the code above? log.Println(string(appConfig.CertValue)) in the line immediately before the Cache call should suffice.

@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 cnf.CacheUnmanagedCertificatePEMBytes() works perfectly for me. So I'd need a full reproducer to verify there is a bug.

@mholt this is the output as you requested - right before calling cacheUnmanagedCertificatePEMBytes:

-----BEGIN CERTIFICATE-----
MIIHDjCCBPagAwIBAgIQPstk5XlT2Hmq1k/pat3iwzANBgkqhkiG9w0BAQsFADBp
MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24x
GDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjEeMBwGA1UEAwwV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zJBjSWFupwWRoyeXkLtoh/D1JIPb9s2KJELtFOt3JY04kTlf5Eq/jXixtu
nLwsoFvVagCvXzfh1foQC5ichucmj87w7G6KVwuA406ywKBjYZC6VWg3dGq2ktuf
oYYitmUnDuy2n0Jg5GfCtdpBC8TTi2EbvPofkSvXRAdeuims2cXp71NIWuuA8ShY
Ic2wBlX7Jz9TkHCpBB5XJ7k=
-----END CERTIFICATE-----

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.

mholt commented

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.