When I generate webservice client stubs using Apache Axis, I disable the server certificate trust check in my code using the client stubs by calling the following method
AxisProperties.setProperty("axis.socketSecureFactory",
"org.apache.axis.components.net.SunFakeTrustSocketFactory");
How do I disable the trust check with client stubs that were generated by running wsimport
?
I use this when I am running some test code.
All that's happening in that class is the provision of a bogus trust store manager, that trusts anything. Knowing that, you can use this article and put something together.
First the easy trust manager
Then feed your trust manager to an instance of
SSLContext
, just like axis was doing:Setup the custom context, by calling
HttpsURLConnection#setDefaultSSLSocketFactory
based on the fact that all your web service calls are based on an underlying instance ofHttpsURLConnection
. This call will setup the context, by way ofSSLContext#getContext
, for all https calls