Hi, I'm trying to access the web services hosted by our client. We were provided a certificate to use while establishing the connection and I can use the same to actually look at their wsdl file through the internet explorer.
I've created a new keystore and imported the certificate provided to us using the following command.
"keytool -import -v -trustcacerts -alias client -file client.cer -keystore company.keystore"
This actually creates a file called company.keystore, which can be used, while generating the java stub files using wsdl2java, by accessing their url. And my wsdl2java command looks like this.
java -Djavax.net.ssl.trustStore=company.keystore org.apache.axis.wsdl.WSDL2Java https://www.client.com/services/hostedWebServices?wsdl
At this point it throws me the following error:
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException:
No trusted certificate found
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(Unknown Source)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(Unknown Source)
at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(Unknown
Source)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown
Sou
rce)
at
sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(Unknown Source)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
So
urce)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unkn
own Source)
at java.net.URL.openStream(Unknown Source)
at org.apache.crimson.parser.InputEntity.init(Unknown
Source)
at org.apache.crimson.parser.Parser2.parseInternal(Unknown
Source)
at org.apache.crimson.parser.Parser2.parse(Unknown Source)
at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown
Source)
at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(Unknown
Source)
at
org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:322)
at
org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:367)
at
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:384)
at
org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245)
at java.lang.Thread.run(Unknown Source)
Caused by: sun.security.validator.ValidatorException: No trusted
certificate fou
nd
at
sun.security.validator.SimpleValidator.buildTrustedChain(Unknown
Sour
ce)
at
sun.security.validator.SimpleValidator.engineValidate(Unknown
Source) at sun.security.validator.Validator.validate(Unknown Source)
at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(
Unknown Source)
at
com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(
Unknown Source)
... 21 moreHere I'm trying to see if I can make a secure connection or not. I've downloaded their wsdl file and created a small java client which also bumps into the same error
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException:
No trusted certificate found
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(Unknown Source)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(Unknown Source)
at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(Unknown
Source)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown
Sou
rce)
at
sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(Unknown Source)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
So
urce)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unkn
own Source)
at java.net.URL.openStream(Unknown Source)
at org.apache.crimson.parser.InputEntity.init(Unknown
Source)
at org.apache.crimson.parser.Parser2.parseInternal(Unknown
Source)
at org.apache.crimson.parser.Parser2.parse(Unknown Source)
at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown
Source)
at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(Unknown
Source)
at
org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:322)
at
org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:367)
at
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:384)
at
org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245)
at java.lang.Thread.run(Unknown Source)
Caused by: sun.security.validator.ValidatorException: No trusted
certificate fou
nd
at
sun.security.validator.SimpleValidator.buildTrustedChain(Unknown
Sour
ce)
at
sun.security.validator.SimpleValidator.engineValidate(Unknown
Source) at sun.security.validator.Validator.validate(Unknown Source)
at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(
Unknown Source)
at
com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(
Unknown Source)
... 21 morePlease let me know where I'm doing wrong.
Thanks in advance Srikrishna
_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee� Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
