I am trying to send a POST request from my server to my another server. It is working well on http, when executed over https, it says internal server error - Unexpected end of file from the server. Here is my code for HTTPS POST.
URL url = new URL("https://.../Action")
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
System.out.println("Connection established");
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
conn.setDoOutput(true);
conn.getOutputStream().write(postDataBytes);
//Error in the following line
in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
`