localConnectionManager.setMaxTotal(1);
connectionManager = localConnectionManager;
// Set up protocol registry
connectionManager.getSchemeRegistry().register(myHttpsProtocol);
BasicHttpParams params = new BasicHttpParams();
params.setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE,true);
params.setIntParameter(CoreProtocolPNames.WAIT_FOR_CONTINUE,socketTimeout);
params.setBooleanParameter(CoreConnectionPNames.TCP_NODELAY,true);
params.setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK,true);
params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,connectionTimeout);
params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT,socketTimeout);
params.setBooleanParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS,true);
DefaultHttpClient localHttpClient = new DefaultHttpClient(connectionManager,params);
// No retries
localHttpClient.setHttpRequestRetryHandler(new HttpRequestRetryHandler()
{
public boolean retryRequest(