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.