I am writing a program where we invoke a third-party SOAP web-service over HTTPS. I am currently receiving an error at the SSL Handshake stage and it fails with the following error - chain violates basic constraints limit.
The web-server is sending a certificate chain as follows:
LEAF - I1 - I2 - I3
My code is able to validate the chain as follows, as I have trusted all the certificates including root:
LEAF - I1 - I2 - I3 - R
However, the issue is that the Intermediate Certificate I3 has a pathLen
of 1
, but it has 2
intermediate certificates between Leaf (End-Entity) certificate and I3 itself, which is causing the issue.
How could this be resolved?
- Do we need to ask the SOAP web-service host/provider to change the certificate configuration on their end?
- Also, how is the server even sending a chain that violates the constraints?
More Information:
I1 (i.e. Intermediate CA 1) has DN
Entrust Certification Authority - L1K
Certificate can be downloaded from here: Download I1 ("entrust_l1k.cer") from Entrust Site
I2 (i.e. Intermediate CA 2) has DN
CN=Entrust Root Certification Authority - G2, OU="(c) 2009 Entrust, Inc. - for authorized use only", OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US
Certificate serial number is
4a538c28
and Certificate can be downloaded from here: Download I2 ("entrust_g2_ca.cer") from Entrust SiteInterestingly, this certificate has same DN and Issuer, but it is not being treated as a root certificate probably because it does not have Authority Key Identifier = Subject Key Identifier.
I3 (i.e. Intermediate CA 3) has DN
CN=Entrust Root Certification Authority - G2, OU="(c) 2009 Entrust, Inc. - for authorized use only", OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US
I3 certificate has the same DN as I2 and is the issuer of I2, but I3 itself is issued by a different authority i.e. root CA, and has a serial number
51d34044
. This certificate also haspathLen
of1
.I cannot find this certificate on the entrust site, so I am pasting the contents here.
-----BEGIN CERTIFICATE----- MIIE/zCCA+egAwIBAgIEUdNARDANBgkqhkiG9w0BAQsFADCBsDELMAkGA1UEBhMC VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0 Lm5ldC9DUFMgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW KGMpIDIwMDYgRW50cnV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ImetAe 733nO2lR1GyNn5ASZqswHwYDVR0jBBgwFoAUaJDkZ6SmU4DHhmak8fdLQ/uEvW0w DQYJKoZIhvcNAQELBQADggEBAGkzg/woem99751V68U+ep11s8zDODbZNKIoaBjq HmnTvefQd9q4AINOSs9v0fHBIj905PeYSZ6btp7h25h3LVY0sag82f3Azce/BQPU AsXx5cbaCKUTx2IjEdFhMB1ghEXveajGJpOkt800uGnFE/aRs8lFc3a2kvZ2Clvh A0e36SlMkTIjN0qcNdh4/R0f5IOJJICtt/nP5F2l1HHEhVtwH9s/HAHrGkUmMRTM Zb9n3srMM2XlQZHXN75BGpad5oqXnafOrE6aPb0BoGrZTyIAi0TVaWJ7LuvMuueS fWlnPfy4fN5Bh9Bp6roKGHoalUOzeXEodm2h+1dK7E3IDhA= -----END CERTIFICATE-----
R (i.e. Root Certificate) has DN
CN=Entrust Root Certification Authority, OU="(c) 2006 Entrust, Inc.", OU=www.entrust.net/CPS is incorporated by reference, O="Entrust, Inc.", C=US
.This certificate has serial number
45 6b 50 54
and can be downloaded from here: Download R ("entrust_ev_ca.cer") from Entrust site
Further info
i1
$ openssl x509 -noout -fingerprint -in entrust_l1k.cer SHA1 Fingerprint=F2:1C:12:F4:6C:DB:6B:2E:16:F0:9F:94:19:CD:FF:32:84:37:B2:D7
i2
$ openssl x509 -noout -fingerprint -in entrust_g2_ca.cer SHA1 Fingerprint=8C:F4:27:FD:79:0C:3A:D1:66:06:8D:E8:1E:57:EF:BB:93:22:72:D4
i3
$ openssl x509 -noout -fingerprint -in i3.cer SHA1 Fingerprint=9E:1A:0C:35:E7:14:B6:97:92:D0:90:B2:CC:4B:BA:45:83:3C:30:15
R
$ openssl x509 -noout -fingerprint -in R.cer SHA1 Fingerprint=B3:1E:B1:B7:40:E3:6C:84:02:DA:DC:37:D4:4D:F5:D4:67:49:52:F9