Question

I have PKCS#12 keystore that I've sucessfully imported in my browser for accessing a server that needs 2-way SSL authentication. Works perfectly reaching any https URL there.

However, I'm unable to access an URL in the same server, and from the same host when using Axis 1.4. The given Axis faultString is:

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

My javax.net.ssl.{keyStore,keyStorePassword,keyStoreType} properties seem to be set up fine.

How can I resolve this?

Was it helpful?

Solution 2

Finally, importing the certificates into my own truststore, using Andreas Sterbenz's InstallCert, and setting the trustStore properties as indicated here did the trick!

OTHER TIPS

I came across a simpler answer if all you want is for your client to be able to call the SSL web service and ignore SSL certificate errors. (Of course you would NOT do this in production!, but it sure is handy for testing.)

Just put this statement before you invoke any web services:

System.setProperty("axis.socketSecureFactory",
    "org.apache.axis.components.net.SunFakeTrustSocketFactory");

I found this at the Axis wiki.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top