we are getting some Probllem and Handshake errors when we are trying to connect Web Service. I will try to describe the Problem Any help would be greatly appreciated.
We imported the certificate (Added Certificate: CN=Data License SubCA) in Java TrustStore, but unfortunately when we want to use it(through our Java-Code), another Root certificate -> RootCA(CN=DigiCert High ) is sent to Webservice. That's why we keep getting handshake errors.
If we use this certificate alone as Default TrustStore, it works because its the only certificate there. But we want to add it to JDK Default TrustStore so we can use our other certificates also.
So what we already done is, imported this specific certificate to default Java-TrustStore, so that it works with other certificates also.
Steps that I already made are:
-
Exported P12 from Provider-certifcate as a CRT to import into TrustStore:
keytool -exportcert -keystore ~/local/ssl/XXCert.p12 -storetype PKCS12 -storepass ourpassword -alias 220220210652062728 -file /opt/ac/common/xxx/home/XXXCert2.crt
-
Imported into default keystore. We will then use custom cacerts
keytool -import -trustcacerts -alias 220220210652062728 -file /opt/ac/common/xx/home/XXXCert2.crt -keystore /opt/ac/common/xxx/local/java/jdk1.8.0_341/jre/lib/security/cacerts
As soon we start the Server, we can see that the certficate is added:
22-09-01 17:18:00,776 ERROR ( 47144512) [stderr] (EJB default - 68) javax.net.ssl|FINE|07 1D|EJB default - 68|2022-09-01 17:18:00.775 CEST|X509TrustManagerImp
l.java:78|adding as trusted certificates (
22-09-01 17:18:00,776 ERROR ( 47144512) [stderr] (EJB default - 68) "certificate" : {
22-09-01 17:18:00,776 ERROR ( 47144512) [stderr] (EJB default - 68) "version" : "v3",
22-09-01 17:18:00,776 ERROR ( 47144512) [stderr] (EJB default - 68) "serial number" : "4C 00 00 00 00 1E 5F 00",
22-09-01 17:18:00,776 ERROR ( 47144512) [stderr] (EJB default - 68) "signature algorithm": "SHA256withRSA",
22-09-01 17:18:00,776 ERROR ( 47144512) [stderr] (EJB default - 68) "issuer" : "CN=Data License SubCA",
...
As soon as we try to send the request, this happens:
22-09-01 17:18:01,713 ERROR ( 47144512) [stderr] (EJB default - 68) javax.net.ssl|FINE|07 1D|EJB default - 68|2022-09-01 17:18:01.712 CEST|X509TrustManagerImp
l.java:237|Found trusted certificate (
22-09-01 17:18:01,713 ERROR ( 47144512) [stderr] (EJB default - 68) "certificate" : {
22-09-01 17:18:01,713 ERROR ( 47144512) [stderr] (EJB default - 68) "version" : "v3",
22-09-01 17:18:01,713 ERROR ( 47144512) [stderr] (EJB default - 68) "serial number" : "02 26 6A 0B 40 9B AC 5C ",
22-09-01 17:18:01,713 ERROR ( 47144512) [stderr] (EJB default - 68) "signature algorithm": "SHA1withRSA",
22-09-01 17:18:01,713 ERROR ( 47144512) [stderr] (EJB default - 68) "issuer" : "CN=DigiCert High Assurance EV Root
And than we get the Handshake-Error, because, originally "CN=Data License SubCA" should be sent, but "CN=DigiCert High Assurance EV Root". is sent
Provider certifiacte, which we added and can be found in TrustStore: CN=Data License SubCA
Its the Problem I think with RootCA and SubCA.
Thanks a lot. Regards