This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of React Cookbook: Recipes for Mastering the React Framework and have David Griffiths & Dawn Griffiths on-line!
See this thread for details.
Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Web Service Client & Certificate

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
We're being followed by intergalactic spies! Quick! Take this tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic