I'm trying to access a SOAP service via SSL. I want to specify the Java
keystore for the SSL socket.
I've been looking at the wiki pages about this, and I've ended up with code
that looks like:
Handler pivot = (Handler) new HTTPSender();
pivot.setOption("trustStore", "/PATH/TO/MY_TRUST_STORE.jks");
pivot.setOption("trustStorePassword", "A BIG SECRET");
Handler transport = new SimpleTargetedChain(pivot);
SimpleProvider clientConfig = new SimpleProvider();
clientConfig.deployTransport(HTTPTransport.DEFAULT_TRANSPORT_NAME,
transport);
WDSoapInterfaceServiceLocator wdsisl = new
WDSoapInterfaceServiceLocator();
wdsisl.setEngineConfiguration(clientConfig);
wdsisl.setEngine(new AxisClient(clientConfig));
...Call SOAP Service....
However, I still get the infamous error:
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
I've put System.setProperty("javax.net.debug", "all") in the code, and this
still shows the JVM default trust store being read, rather than the one I've
specified.
I've also put in the directory (where the .class file is) the file
META-INF/org.apache.axis.components.net.SecureSocketFactory, and that contains
the text "org.apache.axis.components.net.SunJSSESocketFactory"
I know you can do:
System.setProperty("javax.net.ssl.trustStore",....);
System.setProperty("javax.net.ssl.trustStorePassword",...);
And this works in testing. However, because of other SSL/Certificate fun things
within the app, I can't use this method.
Can anyone help me ?
Thanks,
GTG
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]