如何在轴上禁用SSLv2套接字协议 [英] How to disable SSLv2 socket protocol in axis

查看:113
本文介绍了如何在轴上禁用SSLv2套接字协议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用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 此问题感兴趣.)

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆