轴假证书
我正在 java
上使用 axis 来使用 webservice
。 Web 服务采用 https,我想避免检查证书。我在这个论坛中找到了一个解决方案,告诉我将其放在我的代码中:
AxisProperties.setProperty("axis.socketSecureFactory","org.apache.axis.components.net.SunFakeTrustSocketFactory");
我尝试过但没有成功。我已启用: System.setProperty("javax.net.debug", "all");
我在日志的开头看到了这一点:
trigger seeding of SecureRandom
done seeding SecureRandom
%% No cached client session
*** ClientHello, TLSv1 ......
最后它给出了一个错误:
main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
我是吗缺少什么吗?
I am using axis on java
to consume a webservice
. The web service is in https, and I want to avoid the the check for certificate. I found in this forum a solution that tell to put this on my code :
AxisProperties.setProperty("axis.socketSecureFactory","org.apache.axis.components.net.SunFakeTrustSocketFactory");
I tried it but with no success. I have enabled : System.setProperty("javax.net.debug", "all");
and I see this in the begining of the log:
trigger seeding of SecureRandom
done seeding SecureRandom
%% No cached client session
*** ClientHello, TLSv1 ......
And in the end it gives an error :
main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
Am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了禁用协议,需要构建一个实现 :SecureSocketFactory 的类,并在方法
create
中执行此操作:((SSLSocket)sslSocket).setEnabledProtocols(new String[] {"SSLv3", "TLSv1"});
也许这是一个好的开始,您可以使用 JSSESocketFactory 完成的实现。
这个问题的解决方案基于这个问题:链接< /a>
For disable-ing the the protocol is necessary to build a class that implements :SecureSocketFactory and in the method
create
to do this :((SSLSocket)sslSocket).setEnabledProtocols(new String[] {"SSLv3", "TLSv1"});
A good start for this maybe, you can use the implemetation done from : JSSESocketFactory.
The solution for this was based in this question : link