0

my team is facing a SSLException when we try to hit a REST based webservice. We are adding all the headers required to call the webservice.

  • Right now we have got a temporary solution to the problem. We have added the security file from Java 8 folder to the Java 7 folder.
  • There is one more socket based solution which our team tried, but I don't know it on the larger context. But it has been refused to implement too by higher authorities.

We have found that the webservice is based on java 5. And in java 7 some of the security certificates were not available due to which we were getting an error. The first solution works for the testing phase but it's not good for production purposes.

The actual error we are facing is:

  • javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair

During our research we found this question too and tried to follow up every solution given for this question.

So is there anyone who has faced the similar issue before and provide us with a solution to apply, so that we can hit the webservice and add those certificates dynamically at runtime.

Community
  • 1
  • 1
Anant666
  • 416
  • 9
  • 26

2 Answers2

0

Please post the SSL debug logs? I had this problem once and reason was that remote rest service were only supporting TLSv1.2 and we were on TLSv1.1 We called the rest service by mentioning TLSv1.1 protocol in System.setProperty() method.

0

The problem was with the Java version. The security files which were needed by the rest service to hit were not present in Java 1.7.51(our current java version). So instead of changing the security files we upgraded our java version from 1.7.51 to 1.7.80(This version of java contains those security files). Hence no compatibility was broken and the issue was fixed successfully without a workaround.

We got this solution's idea from this StackOverflow Question.

Community
  • 1
  • 1
Anant666
  • 416
  • 9
  • 26