hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "BHAV SINGH BHUKYA-XMK763" <XMK...@motorola.com>
Subject connection timeout problem, javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
Date Fri, 01 Oct 2010 05:22:41 GMT
Hi,
 
  When I try to set the connection timeout in any of the following
methods, I get javax.net.ssl.SSLHandshakeException: Remote host closed
connection during handshake.
  If I dont set the connection timeout it works fine.Thanks in advance
for help.
  
  I am using httpclient3.1 with jdk1.5
Protocol https=new Protocol("https",new
EasySSLProtocolSocketFactory(),5981);

HttpClientParams httpClientParams=new HttpClientParams();

httpClientParams.setSoTimeout(10000);

//set connection parameters

HttpConnectionManagerParams httpConnectionMgrParams=new
HttpConnectionManagerParams();

httpConnectionMgrParams.setConnectionTimeout(100000); //connection
timeout

HttpConnectionManager httpConnectionMgr=new
SimpleHttpConnectionManager();

httpConnectionMgr.setParams(httpConnectionMgrParams);

//create httpclient

HttpClient cpeClient=new HttpClient(httpClientParams,httpConnectionMgr);

cpeClient.getHostConfiguration().setHost(ip,port,https);

//cpeClient.setConnectionTimeout(100000);

//cpeClient.setHttpConnectionManager(httpConnectionMgr);

//cpeClient.getParams().setParameter("http.connection.timeout",cpeDetail
s.getConnectionTimeout());

get=new GetMethod(uri); 

DefaultHttpMethodRetryHandler retryHandler=new
DefaultHttpMethodRetryHandler(2,true);

get.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,retryHandler
);

int status=cpeClient.executeMethod(get);

Thanks,

Bhav.

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message