RaviPatidar
RaviPatidar

Reputation: 1486

Failed to access the WSDL at: https://example.com?wsdl. It failed with: sun.security.validator.ValidatorException

Trying create wsdl client from https://example.com?wsdl. Using this command wsimport -keep https://example.com?wsdl

I have already Installed ssl certificate by using this command keytool -import -alias ctp -file C:\Users\ravi\Desktop\ctplive.cer -keystore C:\Program Files\Java\jdk1.8.0_241\jre\lib\security\cacerts

I am using Window10, Jdk1.8.

Full Error log

Failed to access the WSDL at: https://example.com?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.

Upvotes: 0

Views: 1177

Answers (1)

mkhayata
mkhayata

Reputation: 367

You need to make sure you import the certificate into the Keystore that your JAVA application is using. On Windows or Linux, you might have more than one JRE installed e.g. a standalone JRE, not under your JDK e.g. C:\Program Files\Java\jre..\..\cacerts.

The first thing to do is to check which JRE your application is referencing, you start by checking if you have %JAVA_HOME% ($JAVA_HOME if on Linux) env variable set, this is where usually SSL implementation of JAVA look to find your JRE's cacerts file.

On Windows command line you can find all your JAVAs installation with:

where java

On Linux:

where java
which java

Upvotes: 1

Related Questions