If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.

It's possible you're trying to write to a connection that's already closed. Another cause for this is that you closed the socket with unread data in the socket receive buffer.


This might be caused by unmatching versions of SSL. Java starts normally with SSLv2 and your server might not be able to negotiate. You have to force Java to use SSLv3. See this comment:


You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Client Server problem
    via by 807595,
  • Strange Exception
    via GitHub by dfarina
  • pgpool Bug Tracker
    via by Unknown author,
  • Oracle JDBC thin driver SSL
    via Stack Overflow by user3657792
  • Bug reported at ---------------------------------------------------------- Hi, while supporting an app development team, I'm facing a tough TLS issue - maybe you experts have an idea. They try to open an HTTPS connection to the server URL This is a Web Service of some Brazilian financial authority. So, what I'm basically doing is this: --code snippet-- URL url = new URL(""); HttpsURLConnection con = (HttpsURLConnection)url.openConnection(); con.setHostnameVerifier(new DefaultHostnameVerifier()); // optional default is GET con.setRequestMethod("GET"); System.out.println("Sending 'GET' request to URL: " + url); int responseCode = con.getResponseCode(); System.out.println("Response Code: " + responseCode); --end code snippet- I expect it to return "403 - not authorized". The coding will work with JDK7. However, with JDK8, I get this type of exception: Unrecognized Windows Sockets error: 0: recv failed at Method) at at at at at at at at at at at at at at at at at at ... I can get it to work in JDK8 by forcing it to TLSv1 only, e.g. by setting property -Djdk.tls.client.protocols=TLSv1. For JDK9 I even get a different exception: java.nio.BufferOverflowException at at at at at at at at at at at at at at at at at at Caused by: java.nio.BufferOverflowException at java.nio.HeapByteBuffer.put( at at at at at ... 12 more I've debugged a lot today and tried to get something out of the output but I didn't get any further with this - probably due to my lack of understanding the details of TLS communication and its implementation. I know the server is using some legacy protocol but still I think it should work. Maybe someone has any helpful idea? Is it a bug? You can simply try to run my test code snippet and should see the issue immediately... Thanks Christoph
    via by Xue-Lei Fan,
    • Connection reset by peer: J VM_recv in socket input stream read at Method) at at

    Users with the same issue

    40 times, last one,
    2 times, last one,
    Unknown visitor1 times, last one,
    1 times, last one,
    Михайло Тітов
    1 times, last one,
    209 more bugmates