我试图发送一个请求到我们的一个服务器的url,但每当我尝试连接时,我得到这样的期望
java.net.ConnectException: Received fatal alert: handshake_failure这是我在访问网站时从浏览器中获得的证书详细信息。
Common Name (CN) Go Daddy Secure Certificate Authority - G2
Organisation (O) GoDaddy.com, Inc.
Organisational Unit (OU) http://certs.godaddy.com/repository/我在我的java目录的cacerts中检查了相同的细节。
keytool -list -keystore /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.24.amzn1.x86_64/jre/lib/security/cacerts | grep godaddy
godaddyclass2ca, 23 Sep, 2016, trustedCertEntry,
godaddyrootcertificateauthority-g2, 23 Sep, 2016, trustedCertEntry,这是安装的java版本:
openjdk version "1.8.0_101"
OpenJDK Runtime Environment (build 1.8.0_101-b13)
OpenJDK 64-Bit Server VM (build 25.101-b13, mixed mode)我甚至从浏览器下载了证书并将其导入到cacerts中
keytool -import -keystore cacerts -file test.cer请帮我调试一下。
发布于 2017-11-30 14:24:18
您需要为您的JVM安装JCE扩展。基本上,这个问题是由于您的本地JAVA和https站点之间的密码不匹配造成的。
使用https://www.ssllabs.com/检查您的REST API是否支持java、check this image example
如果显示如下,您可以从http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html下载文件。完成后,将JRE/security目录下的两个JAR (local_policy.jar,US_export_policy.jar)替换为下载的包中的JAR。
如果没有,请提供更详细的信息,以便我们可以详细检查。
在这里查看解决方案我只是累了How to debug the ssl connection error,它对我很有效,节省了我的一天!
https://stackoverflow.com/questions/45467481
复制相似问题