简体   繁体   English

Java https客户端在JDK 1.5中抛出“收到的致命警报:握手失败”,但在JDK1.6上有效

[英]java https client throws “Received fatal alert: handshake_failure” with JDK 1.5 but works on JDK1.6

I am runnning a simple java httpsclient. 我正在运行一个简单的Java httpsclient。 It gives handshake_failure error when compiled and running with jdk1.5 . 使用jdk1.5编译和运行时,它会给出handshake_failure错误。 But works fine with jdk1.6 . 但是可以使用jdk1.6正常工作。 I cannot upgrade my code to jdk 1.6. 我无法将代码升级到jdk 1.6。 Is there anyway I can get this working with jdk 1.5 无论如何,我可以使用JDK 1.5进行此操作

Maybe each JDK is using a different keystore, so one keystore contains a key allowing the connection, and the other does not. 也许每个JDK使用的密钥库都不相同,所以一个密钥库包含一个允许连接的密钥,而另一个则不允许。

See Received fatal alert: handshake_failure through SSLHandshakeException for details of how to enable SSL connection. 有关如何启用SSL连接的详细信息,请参阅通过SSLHandshakeException收到的致命警报:handshake_failure

补充第一个答案,尝试使用Java keytool将证书添加到jdk1.5上的密钥库中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM