1
votes

I am able to access a WSDL via Browser but when I try to access the same WSDL file via java application deployed in my local machine I encounter the below certificate error. I am using java 1.8

I've gone through many answers here for the same issue and I tried almost all of them but still the issue persists.

What I've done so far

1- I exported the certificate from the Chrome, saved it as Base 64.

2- Paste the cer in my JDK location which is C:\Program Files\Java\jdk1.8.0_171\jre\lib\security\mig_root.cer

3- I ran this command: keytool -import -alias cac -file "C:\Program Files\Java\jdk1.8.0_171\jre\lib\security\mig_root.cer" -keystore cacerts -storepass changeit

4- Restart my machine.

5- Still issue persists.

Error

javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://myURL?WSDL. It failed with: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

1

1 Answers

0
votes
  1. Copy the certificate into the directory Java_home\Jre\Lib\Security
  2. Change your directory to Java_home\Jre\Lib\Security>
  3. Import the certificate to a trust store.

keytool -import -alias ca -file somecert.cer -keystore cacerts -storepass changeit [Return]

Trust this certificate: Yes