0

Recently, our organisation migrated one of our Java application codes from Java 8 to Java 11. Now, we are facing one unique issue with our application. Our tomcat server is running into a strange issue, where it is not able to present its self-signed ECDSA certificate to the 3rd party server(requested as part of mTLS SSL negotiation) is failing with the following error.

Error while invoking external url error: Client exception while GET:javax.net.ssl.SSLException: org.bouncycastle.tls.TlsFatalAlertReceived: handshake_failure(40)","error-type":"java.lang.Exception","error-message":"Client exception while GET:javax.net.ssl.SSLException: org.bouncycastle.tls.TlsFatalAlertReceived: handshake_failure(40)","error-stack-trace":"java.lang.Exception: Client exception while GET:javax.net.ssl.SSLException: org.bouncycastle.tls.TlsFatalAlertReceived: handshake_failure(40)

My org uses BC-FIPS provider which doesn’t support -Djavax.net.debug debug param.

I did capture tcpdump, which indicates my application doesn’t present the valid certificate for the SSL negotiation. (Certificate length is 0 in the below snapshot)

Packet Capture

Both the client and server ECDSA certificates are exchanged correctly and are valid. The server, in this case, is able to negotiate inbound ECDSA-based SSL requests (ECDSA cypher) without any issues. Also, the same code works absolutely fine if the cert type is RSA.

We are using the same trustStore that is used in the case of of Java8; there are no changes in the trustStore and the store is generated using the Java8 keytool command like before.

We use bc-fips-1.0.2.3.jar and all dependent libs such as bcpkix-fips.jar,bctls-fips.jar are already added. We have done no changes here, from Java8 to Java11.

The only major change is runtime changes from jre8 to jre 11.

Any pointers to debug or how to take it forward is appreciated.

The trustStore format is BCFKS.

Thanks, Brinal

3
  • 1
    Note that JRE 11 is the first version to support TLS 1.3. Commented Jul 9, 2024 at 11:11
  • True, but I see that TCP communication is happening only in TLS 1.2 Commented Jul 9, 2024 at 11:13
  • 2
    @BoppreH: that was true briefly, but the 1.3-capable stack was backported to 8u261 and up. Plus OP is using the BCJSSE provider (because javax.net.debug doesn't work; note BCJSSE in bctls uses but is separate from BCFIPS in bcprov-fips) which replaces SunJSSE so features of SunJSSE don't matter. Brinal: truststore doesn't matter here, keystore does. I would (quickly) check the CertReq from the server specifies the 'CA' (issuer) name you want to use, and after that with no logging I'd use jdb while examing the source manually. Or one can pay the good people at Bouncy for support. Commented Jul 9, 2024 at 12:17

1 Answer 1

0

The problem was with the ssl.KeyManagerFactory.algorithm property in java.security file. The value was set to SunX509 ,changing the value to PKIX did the trick.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.