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()); }
java ssl gracenote
daniele.guiducci
source share