Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSLException: SSL peer shut down incorrectly

Within my client Ant task to download files off of a Jetty server, I occasionally get a

javax.net.ssl.SSLException: SSL peer shut down incorrectly 
at com.sun.net.ssl.internal.ssl.InputRecord.readV3Record(InputRecord.java:408)
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:360)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:789)

I have Googled for a bit - but so far I do not have a conclusive answer as to why this might be happening.

Can anyone explain what might be the root cause of this exception?

My Jetty logs do not seem to have an equivalent trace of this exception. However, it seems that the Jetty server is indeed terminating the secure connection.

As a bit of a background - I see this exception when two clients spawned by the Ant task use the same certificate to download predetermined files from the Jetty server. The only suspicion I have is that presenting the same certificate by two clients originating from the same host is tripping up the Jetty and it ends up shutting down the connection - but thats just a unproven theory.

like image 416
rmoh21 Avatar asked Aug 08 '12 21:08

rmoh21


1 Answers

This problem can be caused if you have a plaintext socket that you have wrapped in an SSLSocket and you close the plaintext socket rather than the SSLSocket. The exception is warning about a possible truncation attack.

Of course it can also be caused by a real truncation attack.

like image 200
user207421 Avatar answered Sep 28 '22 10:09

user207421