wood burning stoves 2.0*
The moose likes Web Services and the fly likes Two Way SSL Authentication :: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Two Way SSL Authentication ::" Watch "Two Way SSL Authentication ::" New topic
Author

Two Way SSL Authentication ::

Ank Sin
Greenhorn

Joined: Feb 24, 2012
Posts: 2
I have created a trustore with certificates and keystore with the private key.
i have put the following code, loaded the trsustore manger and keystore manager and then created the instance of SSL Context.

This below code is called whenever i am making a request to webservice.
We are using axis2 API.




1.) Issue is when i register my "HTTPS" protocol with above secureProtocolSocketFactory , it effects my whole application as a result of which i cannot get authenticated for other "HTTPS" request, can i somehow set these for a particular host only or particular webservice..???



2.) To avoid setting the above for whole "HTTPS", i thought of setting for partcular hostname



Tried with this as well


it gives me below error..

org.apache.axis2.AxisFault: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Where hostname is "qartap.csnet.assurity.sg" and my webservice URL is "https://qartap.csnet.assurity.sg:8443/RTAPService/RTAPService"

Either i want to set this using hostname or creating new protocol itself...I tried the approach given in the solution here. But it gave me the following exception..



I have created a trustore with certificates and keystore with the private key. i have put the following code, loaded the trsustore manger and keystore manager and then created the instance of SSL Context.

This below code is called whenever i am making a request to webservice. We are using axis2 API.

Tried with this as well


it gives me below error..

org.apache.axis2.AxisFault: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Where hostname is "qartap.csnet.assurity.sg" and my webservice URL is "https://qartap.csnet.assurity.sg:8443/RTAPService/RTAPService"

Issue is when i register my "HTTPS" protocol, it effects my whole application, can i somehow set these for a particular host only or particular webservice..???

Either i want to set this using hostname or creating new protocol itself...I tried the approach given in the solution here. But it gave me the following exception..

While passing the webservice URl to the generated stub constructor, i replaced the "HTTPS" from the url with my own customised "myHTTPS".

The system cannot infer the transport information from the myhttps://serverUrl:7001/app/services/RTAPDevService.RTAPDevServiceHttpSoap12Endpoint/ URL.
 
jQuery in Action, 2nd edition
 
subject: Two Way SSL Authentication ::
 
Similar Threads
"javax.net.ssl.keyStore" system property inside a jar package
javax.net.ssl.SSLException: No available certificate or key corresponds to the SSL cipher suites whi
HttpClient with a certificate
where is this code getting the expired certificate?
Connecting to https urls from Java