Skip to main content

JAX-WS and SSL

3 replies [Last post]
khayk
Offline
Joined: 2008-04-02
Points: 0

Dear forum attendees, I urgently need your assistance, please!

There is a Web-service generated with Jax-ws. As well as, there is a generated client (class WSOfflineCallsImpl), that has been input in an offline application that will be connected to the service.

For connecting to the service it was necessary to do the following –
WSOfflineCallsImpl offlineService = new WSOfflineCallsImplService().getWSOfflineCallsImplPort();

Now this has been modified and getting connected to the server it is possible only through another linking server which demands a trust certificate, i.e. I need to get connected through the https and send that certificate.

So, my question is; How can I realize that or is there any other way for me to use SSL and Jax-ws services together?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ragnorok
Offline
Joined: 2008-04-28
Points: 0

- Get a certificate and put it in a jks keystore and put it where-ever you like; mine is with the application that requires SSL authentication. When you add your certificate be sure to make the keystore and keypair password the same. If you do not, you will have to also include the keypair password in the System.properties settings below.
- Get the public certificate from the server and add it to cacerts at your JVM install location.
- Set the keystore path, keystore password, truststore path (to cacerts), and truststore password in the appropriate System.properties. I have these in a properties file that's loaded at application initialization; to turn off SSL in this case simply comment out (with a wakka) the SSL configuration parameters.
- Connect using an SSL URL. If you have trouble enable SSL debug by putting "-Djavax.net.debug=ssl,handshake" on the java command line that launches your code. This will spew TONS of stuff on the console so be sure you have a huge buffer on it.
- The above should give you enough clues to search for more information on putting the individual steps into effect.
- Hope this helps...

noletolucas
Offline
Joined: 2006-07-07
Points: 0

> - Get the public certificate from the server and add
> it to cacerts at your JVM install location.
[b]keytool.exe -import -file c:\publicCert.crt -- is it like this? Specifying -keystore prompted me for a password and then said it was incorrect.[/b]

> - Set the keystore path, keystore password,
> truststore path (to cacerts), and truststore
> password in the appropriate System.properties.
[b]You mean override the defaults?[/b]

htoulan
Offline
Joined: 2008-04-14
Points: 0

Hi,

I need to authenticate my JAVA client to an "Exchange 2007" web service, using NTLM.
I have to use JAX-WS (instead of Axis2) and I don't manage to make the Auhtenticator work

I still have the same error :
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

any idea?

Hervé