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: https://goo.gl/hx0YB3
java.net.SocketException: Connection resetat java.net.SocketInputStream.read(SocketInputStream.java:168)at com.sun.net.ssl.internal.ssl.InputRecord.a(DashoA6275)at com.sun.net.ssl.internal.ssl.InputRecord.read(DashoA6275)at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)at com.sun.net.ssl.internal.ssl.AppInputStream.read(DashoA6275)at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)at java.io.BufferedInputStream.read(BufferedInputStream.java:201)