I don't have to fix something that doesn't work, but I try to understand why something works, because I think it should not work.
I'm using OpenJDK11 / Ubuntu 16.04. I make an HTTPS call. The SSL handshake succeeds.
The cert chain contains 3 certs:
- API certificate of course. Issued by an intermediate CA (issuer = CN = DigiCert TLS RSA SHA256 2020 CA1,O = DigiCert Inc,C = US)
- Intermediate CA certificate. Issued by a root CA (issuer = CN = DigiCert Global Root CA,OU = www.digicert.com,O = DigiCert Inc,C = US)
- Root certificate
The second certificate is not available in the cacert keystore in use (default keystore under lib/security folder). This sounds quite normal as the cert was issued in April 2021, while the JRE was released on January 2021 (openjdk version "11.0.10" 2021-01-19)
Why can this handshake succeed? In my mind, as Java doesn't know the second certificate, it can not validate the API certificate.