On Thu, 2006-02-16 at 14:42 +0100, [EMAIL PROTECTED] wrote: > Hi, > > I inherited the maintanance of a program > that utilizes HttpClient 2.0.x class for https call > on a linux box running in a 1.3.x JVM. > > This program is called thousands of times a day. > Ocassionally (once a month) this program fails with a > ConnectionTimeoutException even though there are > generous timeouts set. Subsequent executions > of this program will then fail for the same reason. > At present we reboot the box to overcome this failure. > > > The following i already tried with no success: > > Migrate to 1.4.x JVM decomissioning the external JSSE libs. > Migrate to HttpClient 3.0.x. However if I do this the program > hangs trying to open the connection even though both socket > and conection timeout is set. > > > The following i tried with success: > > Run the program in 1.5.x JVM. This does fine regardless on what > my build is based. This now totally confuses me. What is the difference > to the 1.4.x JVM ? > > > Any hint is aprecitated,
Gerrit, To my knowledge Sun's implementation of JSSE in 1.5 has been completely rewritten to order to enable NIO (non-blocking I/O) support for secure sockets. It is not surprising at all that one may get totally different results when using SSL with Sun JRE 1.4 and 1.5. Firstly, there is no reliable way to enforce the socket connection timeout in Java prior to Java 1.4, so seriously consider upgrading to Java 1.4 or 1.5. HttpClient 2.0 employs some really nasty hack to simulate the connect timeout which it is not 100% reliable and requires a controller thread to be spawned on each connection attempt. HttpClient 3.0 makes use of reflection to invoke Java 1.4 specific socket methods when available. Secondly, consider implementing a custom socket factory which directly uses 1.4 specific methods when opening sockets. This socket factory can be used as an example http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java?view=markup Thirdly, consider upgrading to HttpClient 3.0. HttpClient 2.0 is no longer supported. Hope this helps Oleg > thank you, > Gerrit > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
