hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Connection either times out or hangs using https
Date Thu, 16 Feb 2006 14:06:11 GMT
On Thu, 2006-02-16 at 14:42 +0100, gerrit.schutte@ubs.com 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: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message