Java 在soapUI Pro 中启用TLS 1.2
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22804441/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Enable usage of TLS 1.2 in soapUI Pro
提问by Robert Strauch
I need to connect to a webservice which only accepts connections established via TLS 1.2. Other versions are not supported.
我需要连接到一个只接受通过 TLS 1.2 建立的连接的网络服务。不支持其他版本。
My test client (soapUI Pro) uses JRE 1.7_45 which - according to the following link - generally supports TLS 1.2 which is not enabled by default for clients. I don't have control over the test client's source code so I need to enable TLS 1.2 via some Java options or else.
我的测试客户端 (soapUI Pro) 使用 JRE 1.7_45,它 - 根据以下链接 - 通常支持客户端默认未启用的 TLS 1.2。我无法控制测试客户端的源代码,因此我需要通过某些 Java 选项或其他方式启用 TLS 1.2。
http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.html#tlsprotonote
http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.html#tlsprotonote
However I cannot find any information how to enable TLS 1.2 for the JVM.
但是,我找不到任何有关如何为 JVM 启用 TLS 1.2 的信息。
采纳答案by Robert Strauch
The following parameter must be added to the soapUI vmoptions file in soapUI's bin directory:
必须将以下参数添加到soapUI 的bin 目录中的soapUI vmoptions 文件中:
-Dsoapui.https.protocols=TLSv1.2
回答by spinlok
You need to pass the protocol to SSLContext
- docs
您需要将协议传递给SSLContext
- docs
SSLContext context = SSLContext.getInstance("TLSv1.2");
You can then use context
to create an SSLEngine
然后您可以使用context
创建一个SSLEngine
context.createSSLEngine();
Read the JSSE guideon how to make SSL connections using SSLEngine
阅读有关如何使用 SSL 连接的JSSE 指南SSLEngine