java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation

JAVA中调用思科的IP电话时 生产环境报异常:

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

意思是要导入证书, 但是经过证书导入到Linux环境中后,却报这个异常:

java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
    at javax.net.ssl.DefaultSSLSocketFactory.throwException(SSLSocketFactory.java:198)
    at javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java:205)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

意思是导入证书有问题,或者是未寻找到证书.

辗转反侧:最后在stack overflow 中找到一篇文档: 让https 在执行Axis时进行忽略证书的认证:程序之前加入下面一行代码:

AxisProperties.setProperty(“axis.socketSecureFactory”,“org.apache.axis.components.net.SunFakeTrustSocketFactory”);
部署 ,成功呼起IP电话.困扰几天的问题终于解决了.

转载至https://stackoverflow.com/questions/10913185/ignore-certification-authentication-on-axis-client-for-wcf-service

猜你喜欢

转载自blog.csdn.net/suzl478068/article/details/84614912