Ignore certification authentication on Axis client for WCF service

蹲街弑〆低调 提交于 2019-11-29 15:40:31

问题


I created an axis client to WCF service (the client was generated by Eclipse, using the WSDL as an input).

The client works fine when using HTTP.

When using HTTPS I'm getting the following exception:

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

I understand the error, but I don't want to give it a place where the certificates are located.

I want to tell Axis to avoid this step (accept any certificate without checking it).

I know how to do it with HttpsURLConnection (create a custom validator which does nothing), but I don't know how to do it with axis... (How can I tell axis to use my custom validator, or better, how can I tell it to ignore this step at all).

Can someone help me?

Thanks,

Mattan


回答1:


I had the same problem and fixed it using:

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

In case this doesn't work, have a look here.



来源:https://stackoverflow.com/questions/10913185/ignore-certification-authentication-on-axis-client-for-wcf-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!