Forums: 

Sometime your server return a bad ssl header and java8 throw an exception, both with URL and HTTPCLIENT class.

I think java8 has some stricly rules about ssl header. Try to run the code above and you will see that simetimes it generate an exception. It's also impossible to develope a prototype.

Thx.

Daniele

Example code:

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());
}

The article is very nice as well as very informative. i have known very important over here i want to thank you for this informative read dvd media player windows 10 is a awesome quality and laterst version i sure like it thanks for sharing it.

Forum Discussions