如何在轴上禁用SSLv2套接字协议 [英] How to disable SSLv2 socket protocol in axis
问题描述
我在使用axis使用Web服务时遇到问题.这是因为axis发送了SSLv2 ClientHello,而提供Web服务的服务器不支持SSLv2协议.为了解决这个问题,我必须禁用此协议.在Java中禁用它的代码是:
I have a problem with consuming a web service using axis.This happen because axis sent a SSLv2 ClientHello and the server that offer the webservice does not support the SSLv2 protocol. To fix this i have to disable this protocol. The code for disable it in Java is :
SocketFactory socketFactory = SSLSocketFactory.getDefault();
SSLSocket socket = (SSLSocket) socketFactory.createSocket(hostname, port);
socket.setEnabledProtocols(new String[] {"SSLv3", "TLSv1"});
我指的是这些链接 .现在,问题是当我使用Axis来消费Web服务时如何禁用该协议?
I refer to these link. Now, the problem is how can I disable this protocol when I am using axis for consuming the webservice?
推荐答案
如果使用的是Axis 2,则应该能够配置Apache HttpClient 3.x 有关此主题的第2轴文档).返回套接字之前,您应该能够在createSocket
中设置已启用的协议. (您可能还对此问题感兴趣.)
If you're using Axis 2, you should be able to configure an Apache HttpClient 3.x SecureProtocolSocketFactory
(see the Axis 2 documentation on the subject). You should be able to set the enabled protocols in createSocket
before returning the socket. (You might also be interested in this question.)
对于Axis 1,您应该能够将axis.socketSecureFactory
属性设置为您自己的类名称,从而实现
For Axis 1, you should be able to set the axis.socketSecureFactory
property to your own class name implementing an Axis SecureSocketFactory
and configure the socket in the same way there.
这篇关于如何在轴上禁用SSLv2套接字协议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!