Solved

Consume rpc/encoded webservice using axis + client certificate

Posted on 2014-01-02
4
554 Views
Last Modified: 2014-01-07
Hi,

I'm trying to build a webservice client using IntelliJ 13.
The webservice is rpc/encoded so I'm using an old version of Axis (I think it's 1.4).
I need to use a client certificate to access it.

The client I created works fine with the non-https version, but now I need to add the magic to make client certificates work. I found lots of examples on the internet but it's all for Axis 2 and I'm using an older version. Axis 2 doesn't support rpc/encoded.

So, my question is: what do I have to do to load a client certificate before I access the webservice?

regards,

Marco
0
Comment
Question by:mvanrooij
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 36

Assisted Solution

by:mccarl
mccarl earned 250 total points
ID: 39752820
Have you tried setting the System Properties "javax.net.ssl.keyStore" to point to the location of your file containing the client certificate and "javax.net.ssl.keyStorePassword" to the password for that keystore file?

If everything is left as default, I believe the Axis (even 1.4) will use the standard Java SSL implementations that will use the above system properties to locate a keystore containing the client certificate. And then when the server request the client certificate (as part of the SSL handshake), the certificate can be found and passed along to the server.

Have you debugged the SSL connection to see exactly what is happening between client and server? (You can do this by setting an additional system property "javax.net.debug" to "all", ie.       -Djavax.net.debug=all       )
0
 
LVL 1

Accepted Solution

by:
mvanrooij earned 0 total points
ID: 39753363
Yes, I tried that but the problem is that System.setProperty makes the setting global and I need to be able to switch certificates at runtime.

After trying to sort this out all night I found an interesting website where a custom SocketFactory is explained. I implemented it and guess what... it works great!

http://staff.washington.edu/fox/notes/ws_client_j.shtml
0
 
LVL 36

Expert Comment

by:mccarl
ID: 39753781
I need to be able to switch certificates at runtime.
Ahh, that wasn't stated in the original question. So yeah, you would need the different solution. Glad that you got it working though! :)
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New Relic recently released its Synthetics product that allows for the creation of performance monitors that periodically test a site's performance. If you wish to test an interactive workflow New Relic employs Selenium WebDriverJS to run those test…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question