jQuery in Action, 2nd edition
The moose likes Web Services and the fly likes AXIS over SSL trusting all certificates Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "AXIS over SSL trusting all certificates" Watch "AXIS over SSL trusting all certificates" New topic
Author

AXIS over SSL trusting all certificates

Tasja Mango
Greenhorn

Joined: Mar 03, 2004
Posts: 8
Hello,

I had serious problems making work AXIS over SSL (1.1, JDK14). All the time, I got "javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found".

The first thing to try was the well known solution:

TrustManager[] tm = new TrustManager[ 1 ];
tm[0]=new NaiveTrustManager( ); // accepts all
context.init(null, tm, new SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());

But AXIS absolutely refused to take setting this into account, the SUN default class got called every time.

On the net, google, AXIS mailing lists, etc no one had really a solution. Either there was never an answer, "use CommonsHttpSender & config HttpClient" (too complicated since need to rebuild AXIS), or "import server certs to your keyring" (not a acceptable solution for me)...

After some hours in the AXIS source codes, I stumbled over the SocketFactoryFactory...

All what's needed is provided by AXIS:

AxisProperties.setProperty("axis.socketSecureFactory","org.apache.axis.components.net.SunFakeTrustSocketFactory");

et voila...

This post just to share a useful information...
Natasha
Lukas Bradley
Greenhorn

Joined: Feb 18, 2005
Posts: 2
Natasha,

I could use your help on setting up this same service. I'm more than willing to pay you for your time.

Would you please contact me at lukas at somnia.com? Thanks.

Lukas
 
 
subject: AXIS over SSL trusting all certificates
 
developer file tools