Randomly SSLException Unsupported record version Unknown-0.0

丶灬走出姿态 提交于 2019-11-28 21:41:01

I got the same error message in a new java installation when trying to use an SSL connection that enforces 256-bit encryption. To fix the problem I found I needed to install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files (e.g. http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html)

I had this line

    SSLContext sc = SSLContext.getInstance("SSL");

Had to change it to

    SSLContext sc = SSLContext.getInstance("TLSv1");

And now it works on both, java 7 and java 8

Note: (In java 7 SSL and TLS both worked with the same url, in java 8 just tried TLSv1 but I guess SSLv1 also works)

According to the stack trace, the RecordVersion Unknow-0.0 is produced from here => referenced from here => which is invoked in InputRecord.readV3Record

most of the time, these two values should not be 0, the reason for this happening is probably the wrong response from server while handshaking.

(This is not an answer though, just some information for easier figuring out the problem and solution)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!