This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Web Services and the fly likes Connecting to HTTPS webservice (through oracle- OC4J Jdeveloper) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Connecting to HTTPS webservice (through oracle- OC4J Jdeveloper)" Watch "Connecting to HTTPS webservice (through oracle- OC4J Jdeveloper)" New topic
Author

Connecting to HTTPS webservice (through oracle- OC4J Jdeveloper)

Will Kwee
Greenhorn

Joined: Jul 21, 2005
Posts: 2
I am having issues while trying to connect to a webservice that require SSL. Has anybody seen similar exception below or any suggestion of how to setup the cert (using the DER X.509 since the PKCS #12 format not supported)?

WARNING: Unable to connect to URL: https://itsolutions/AppIntegration/org/test/sendRequest.jpd due to java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
java.rmi.RemoteException: ; nested exception is:
HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target


WH
D Algger
Greenhorn

Joined: May 08, 2008
Posts: 1
I've seen this.

What you need to do is provide a keystore with the target server's SSL certificate.

Then you need to make your program aware of it. Here is how I did it:

File kstore = new File("./security/sslStore.jks");
boolean exists = kstore.exists();
if(!exists) {
throw new mypkg.KeyStoreNotFoundException(kstore.getName());
}

System.setProperty("javax.net.ssl.trustStore", kstore.getAbsolutePath());
System.setProperty("javax.net.ssl.trustStorePassword", "password");


After that, the system will be able to verify the target server's SSL cert.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"If Only",
Please check your private messages regarding an important administrative matter.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connecting to HTTPS webservice (through oracle- OC4J Jdeveloper)