我们的应用程序与之集成的第三方最近对其安全级别协议进行了更改。简而言之,My Axis 客户端现在应该使用 TLSv1.1 或 TLSv1.2 发送调用。我看过其他关于这个的帖子,有一些好主意:
在对代码进行了这些更改之后,我再次触发了调用,我使用了一个截图工具来监控发送的包,我仍然在 SSL 层看到正在使用的协议是 TLSv1。
我在这里做错了什么?
这就是我设置新 SocketSecureFactory 的方式:
AxisProperties.setProperty("axis.socketSecureFactory", MyTLSSocketSecureFactory.class.getName());
而 MyTLSSocketSecureFactory 是:
public class MyTLSSocketSecureFactory extends JSSESocketFactory {
public MyTLSSocketSecureFactory(Hashtable attributes) {
super(attributes);
}
@Override
public Socket create(String host,int port, StringBuffer otherHeaders,BooleanHolder useFullURL)
throws Exception{
Socket s = super.create(host, port, otherHeaders, useFullURL);
((SSLSocket)s).setEnabledProtocols(new String[] {"TLSv1.1", "TLSv1.2"});
return s;
}
}
非常感谢任何评论,谢谢。