0
votes

i making a call to the webservices using Axis implementation by SSL certificate. I added the certificate to my keystore using the keytool.

it showed as "Certificate was added to the keystore". But when I run the java program i get the following exception

AxisFault

faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: 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 faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace: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 at sun.security.ssl.Alerts.getSSLException(Unknown Source) at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source) at sun.security.ssl.Handshaker.fatalSE(Unknown Source) at sun.security.ssl.Handshaker.fatalSE(Unknown Source) at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source) at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source) at sun.security.ssl.Handshaker.processLoop(Unknown Source) at sun.security.ssl.Handshaker.process_record(Unknown Source) at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source) at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) a

Any suggestions as How to import the SSL certificate when making a call to the webservice Axis

2
Can anyone just guide me in this? I am really stuck with this and do not know how to proceed furtheruser3622196

2 Answers

0
votes

Issue might be certificates chain was not properly imported into cacerts file. The server authentication part should be easy. Just stick the required cert(s) in the provided cacerts truststore..

see this http://docs.oracle.com/javase/1.5.0/docs/tooldocs/solaris/keytool.html for some info on using keytool to work with the cacerts truststore.

0
votes

Thank you for the suggestions. The issue with my keytool was the place where my java program was running and the place where my keytool certificate was added were different. Now I was able to invoke the webservices.

Correct way of adding the certificate through keytool

keytool -import -alias (alias here) C:\test\certificate location -keystore "C:\Program Files\Java\jre7\lib\security\cacerts"

Thanks again:)