Random SSLException Unsupported record version Unknown-0.0

Sometimes the code below fails, and sometimes it works. I am using Java8. Is this a server side issue?

An exception in the stream "main" javax.net.ssl.SSLException: Unsupported version of the record Unknown-0.0.

EDIT: I am downgrading to JDK7 from JDK8 and it works. The only solution I found works.

public static void main(String[] args) throws Exception { URL u = new URL("https://c********.web.cddbp.net/webapi/xml/1.0/"); HttpURLConnection connection = (HttpURLConnection) u.openConnection(); connection.setDoOutput(true); connection.setDoInput(true); connection.setInstanceFollowRedirects(false); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", "text/plain"); connection.setRequestProperty("charset", "utf-8"); connection.setRequestProperty("Content-Length", "" + 140); connection.setUseCaches(false); DataOutputStream wr = new DataOutputStream(connection.getOutputStream()); } 
+7
java ssl gracenote
source share
3 answers

I got the same error message in a new java installation while trying to use an SSL connection that provides 256 bit encryption. To fix this problem, I found that I need to install jurisdiction policy files with unlimited degree of protection (JCE) (for example, http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124 .html )

+7
source share

I had this line

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

I 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 work with the same URL, in java 8 just tried TLSv1, but I think SSLv1 also works)

+1
source share

According to the stack trace, RecordVersion Unknow-0.0 is created from here => link here => which is called in InputRecord.readV3Record

in most cases, these two values ​​should not be 0, the reason for this is probably the incorrect response of the server at the time of establishing a connection.

(This is not an answer, but simply some information for an easier clarification of the problem and solution)

0
source share

All Articles