You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Kesavan T.S" <ts...@hotmail.com> on 2005/01/13 17:10:23 UTC

SSL Handshake error

Hi ,
Were using httpclient 2.02 on IBM Websphere 5.1. It works great but we get 3 
or 4 SocketException SSL Handshake failure  per day (for about 5000-8000 
hits) which is ok. But the problem is we are using connection time out and 
read timeout but during these exception looks like the write is hanging for 
much more than the timeout.
We are doing

        HttpClient httpClient = new HttpClient();
        GetMethod getMethod = new GetMethod(getURLString());

        httpClient.
            setConnectionTimeout(5000);
        httpClient.
            setTimeout(5000);

           try{
            int responseCode = httpClient.executeMethod(getMethod);
            Log.debug(this,"getData()","HTTP_RESPONSE_CODE = " + 
responseCode);
            is = getMethod.getResponseBodyAsStream();

            byte buf[] = new byte[4096];
            int nSize = is.read(buf);
           while(nSize>=0)
           {
	String data = new String(buf,0,nSize);
	sBuffer.append(data);
	nSize = is.read(buf);
           }
           }finally
           {
	if(is != null)is.close();
                getMethod.releaseConnection();
           }
This is the exception and during this exceptin the httpclient hangs for more 
than 120 seconds:

Caused by: java.net.SocketException: SSL handshake failure
	at com.ibm.sslite.m.c(Unknown Source)
	at com.ibm.sslite.m.f(Unknown Source)
	at com.ibm.sslite.m.a(Unknown Source)
	at com.ibm.sslite.n.<init>(Unknown Source)
	at com.ibm.sslite.be.a(Unknown Source)
	at com.ibm.sslite.be.<init>(Unknown Source)
	at com.ibm.jsse.bs.a(Unknown Source)
	at com.ibm.jsse.b.a(Unknown Source)
	at com.ibm.jsse.b.write(Unknown Source)
	at 
org.apache.commons.httpclient.HttpConnection$WrappedOutputStream.write(HttpConnection.java(Compiled 
Code))
	at 
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java(Inlined 
Compiled Code))
	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java(Compiled 
Code))
	at 
org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java(Inlined 
Compiled Code))
	at 
org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java(Compiled 
Code))
	at 
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java(Compiled 
Code))
	at 
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java(Compiled 
Code))
	at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java(Compiled 
Code))
	at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java(Compiled 
Code))

I would really appreciate if someone can suggest how to resolve this.
Regards,
kesacan



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