Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Web Service Client & Certificate  RSS feed

 
Mark Alan West
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good morning!

I am trying to create a Web Service client. The WSDL style is RPC/Encoded and the service runs over SSL & requires a digital certificate.

So far I have done the following:

(1) Downloaded the certificate from the Client Site using IE.
(2) Imported the *.cer file into a keystore.
(3) Generated a client using the Axis 1.4 WSDL2Java tool (RPC Encoded not support by Axis 2 or XFire).

The problem is, I don't know how to get the client to use my local keystore when it talks to the server. I was hoping that I could just add some code to the following client:

AxisGeneratedService service = new AxisGeneratedServiceLocator();
AxisGeneratedPort port = service.getAxisGeneratedPort();
port.doService();

I would prefer not to change the code that was generated by Axis, as this can easily be overwritten.

Can anyone help me out here? Do I need to do more with the keystore? Or can I just add a few simple lines of code to me client?


Mark.
 
Mark Alan West
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I should add that I've now searched the forums, and have tried specifying the following parameters in my client, all without any change:

java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
System.setProperty("java.protocol.handler.pkgs","blah");
System.setProperty("javax.net.ssl.keyStore", "blah");
System.setProperty("javax.net.ssl.keyStorePassword", "blah");
System.setProperty("javax.net.ssl.trustStore", "blah");
System.setProperty("javax.net.ssl.trustStorePassword", "blah");

However I am still getting the following:

main, SEND TLSv1 ALERT: fatal, description = certificate_unknown
main, WRITE: TLSv1 Alert, length = 2
main, called closeSocket()
main, handling exception: 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
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!