Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-735

IMAP missing timeout on SSL handshake

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.5, 3.11.1
    • None
    • IMAP
    • None
    • Patch

    Description

      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) {

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            jkamp John van der Kamp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: