Solved

Consume rpc/encoded webservice using axis + client certificate

Posted on 2014-01-02
4
559 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
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.
Suggested Courses

624 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