John van der Kamp created NET-735:
-------------------------------------

             Summary: IMAP missing timeout on SSL handshake
                 Key: NET-735
                 URL: https://issues.apache.org/jira/browse/NET-735
             Project: Commons Net
          Issue Type: Bug
          Components: IMAP
    Affects Versions: 3.11.1, 3.5
            Reporter: John van der Kamp


When an SSL handshake is not being received due to network issues, this is not 
detected and the connection hangs waiting for data. The code does not install a 
timeout on the ssl socket.

 

We are using the following patch to fix this:

 

{{--- 
commons-net/commons-net/3.11.1/commons-net-3.11.1-sources/org/apache/commons/net/imap/IMAPSClient.java}}
{{+++ 
commons-net/commons-net/3.11.1/commons-net-3.11.1-sources/org/apache/commons/net/imap/IMAPSClient.java}}
{{@@ -282,6 +282,7 @@ public class IMAPSClient extends IMAPClient {}}
{{         final SSLSocket socket = (SSLSocket) ssf.createSocket(_socket_, 
host, port, true);}}
{{         socket.setEnableSessionCreation(true);}}
{{         socket.setUseClientMode(true);}}
{{+        socket.setSoTimeout(1000);}}
{{ }}
{{         if (tlsEndpointChecking) {}}

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to