[ 
https://issues.apache.org/jira/browse/NET-735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17926178#comment-17926178
 ] 

Gary D. Gregory commented on NET-735:
-------------------------------------

Hello [~jkamp] 

Did you try calling:
-  {{org.apache.commons.net.SocketClient.setConnectTimeout(int)}}?
-  {{org.apache.commons.net.SocketClient.setSoTimeout(int)}}?

{{SocketClient}} is the root class of {{IMAPSClient}}.


> 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.5, 3.11.1
>            Reporter: John van der Kamp
>            Priority: Major
>
> 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