我正在尝试与trackobot.com建立连接以接收一些JSON数据.服务器仅允许通过HTTPS/SSL进行连接.这是代码:
java.lang.System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");
URL url = new URL("https://trackobot.com/profile/history.json?username=USER&token=TOCKEN");
InputStream is = url.openStream();
JsonParser parser = Json.createParser(is);
Run Code Online (Sandbox Code Playgroud)
openSteam抛出javax.net.ssl.SSLHandshakeException:收到致命警报:handshake_failure
我阅读了几篇与类似问题相关的帖子,但没有一个建议有帮助.相应的证书在我的信任库中.当我尝试连接到例如google.com时,没有错误.所以,问题似乎是在我试图连接的服务器的握手特定中.
我使用-Djavax.net.debug = ssl运行我的代码返回:
keyStore is :
keyStore type is : jks
keyStore provider is :
init keystore
init keymanager of type SunX509
trustStore is: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/security/cacerts
trustStore type is : jks
trustStore provider is :
init truststore
[Here I removed hundreds of „adding as trusted cert“:… lines]
trigger seeding of SecureRandom
done seeding SecureRandom
Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_GCM_SHA384
Ignoring unavailable cipher suite: …Run Code Online (Sandbox Code Playgroud)