java JDK 1.6 和 SSL 连接

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27000815/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 11:02:53  来源:igfitidea点击:

JDK 1.6 and SSL connection

javassl

提问by sfti9

My java version is 1.6 and connect to a server over ssl using axis 2 stub; all used to work fine. It seems like they did some upgrade (apache2.4) and the ssl handshake doesn't happen anymore. I receive javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake error. Just for testing purpose, I locally installed jdk 8 and tested it works fine. Is there any way to make this work using jdk1.6? It is not possible to upgrade jdk now.

我的 java 版本是 1.6 并使用轴 2 存根通过 ssl 连接到服务器;一切都用来工作正常。看起来他们做了一些升级(apache2.4)并且ssl握手不再发生。我收到 javax.net.ssl.SSLHandshakeException: 在握手错误期间远程主机关闭连接。仅出于测试目的,我在本地安装了 jdk 8 并测试它工作正常。有什么办法可以使用 jdk1.6 完成这项工作吗?现在无法升级jdk。

回答by Steffen Ullrich

It is hard to tell without more details but I guess that the server either requires a TLS version unsupported by JDK 6 (e.g. TLS 1.1 or TLS 1.2) or uses ciphers which are not supported by JDK 6 yet. Another option might be that the server needs SNI (server name indication) which is not supported by JDK 6. If the problem is any of these things you are unfortunately out of luck with JDK 6.

没有更多细节很难说,但我想服务器要么需要 JDK 6 不支持的 TLS 版本(例如 TLS 1.1 或 TLS 1.2),要么使用 JDK 6 尚不支持的密码。另一种选择可能是服务器需要 JDK 6 不支持的 SNI(服务器名称指示)。如果问题是这些问题中的任何一个,您很遗憾 JDK 6 不走运。

I suggest you check with SSLLabsto get more details about the problem. They show also compatibility information regarding various JDK versions.

我建议您与SSLLabs 联系以获取有关该问题的更多详细信息。它们还显示了有关各种 JDK 版本的兼容性信息。

回答by cudiaco

You could try using a 3rd party JCE provider, Bouncy Castle comes into mind: https://www.bouncycastle.org

您可以尝试使用第 3 方 JCE 提供商,Bouncy Castle 会出现在您的脑海中:https: //www.bouncycastle.org