Title: Specific TrustManager for Axis client over SSL

I wanted to define my own TrustManager to define customized actions when web service server is not trusted.
It seems that the way to do it is to use the axis.socketSecureFactory property to define your own socket factory.
But it also seem that the axis SocketFactory interface to implement is a proprietary one (org/apache/axis/components/net/SocketFactory.java).

The problem in my case is that I do not want to create a new SocketFactory class, I'd like to reuse the default one provided by JSSE.

I guess I can write a wrapper on top of the default JSSE one, but it does not seem trivial to do so.

According to what I understood form the JSSE documentation, I need to do something like that:

TrustManager[] myTM = new TrustManager [] { new MyTrustManager() };
SSLContext ctx = SSLContext.getInstance ("TLS");
ctx.init (null, myTM, null);
SocketFactory socketFactory = ctx.getSocketFactory();

And I do not have to write my own SocketFactory in order to do that.
Am I missing something or the only way is to write my own socket factory?

Thanks.

Thomas

Reply via email to