aspose file tools*
The moose likes Security and the fly likes javax.net.ssl.SSLHandshakeException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "javax.net.ssl.SSLHandshakeException" Watch "javax.net.ssl.SSLHandshakeException" New topic
Author

javax.net.ssl.SSLHandshakeException

Raj Kumar Bindal
Ranch Hand

Joined: Apr 15, 2006
Posts: 418
I have applied SSL certificates to one web service(deployed on Microsoft IIS server). When i access that web service directly, it is working fine and i am able to access that web service using https.
Now, i am trying to connect to that webservice using java server in the middle and i am getting problem in this scenario.
So scenario is :
client --accesses-->application deployed on java server----calls--> Web service that is deployed in Microsoft IIS server.

I am not sure, if i am going to IIS server with java server in middle, why is it giving exception.
Exception is :
Error ; nested exception 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
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
unable to find valid certification path to requested target

Please help.
greg stark
Ranch Hand

Joined: Aug 10, 2006
Posts: 220
You don't say whether this exception is coming from your client, your middleware, or your web service. The error means that you do not have your truststore configured correctly.


Nice to meet you.
Dejan Mratinkovic
Ranch Hand

Joined: Nov 20, 2008
Posts: 65
greg stark wrote:The error means that you do not have your truststore configured correctly.


Or, your application deployed on Java server does not have valid/any certificate it represents to IIS. The stuff usually set up with java properties etc.
Raj Kumar Bindal
Ranch Hand

Joined: Apr 15, 2006
Posts: 418
I got the solution.
I imported the certificates into my java server using keytool utility and it worked fine.
Thanks.
SunnySingh Singh
Greenhorn

Joined: Oct 28, 2009
Posts: 1
How do you import the certificates? Is there a common certificate that needs to be loaded one time only, and after that whenever we connect to a https site, we dont need t worry about it?
 
 
subject: javax.net.ssl.SSLHandshakeException