public CommonsHttpTransport(Settings settings, String host) {
this.settings = settings;
httpInfo = host;
HttpClientParams params = new HttpClientParams();
params.setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(
settings.getHttpRetries(), false) {
@Override
public boolean retryMethod(HttpMethod method, IOException exception, int executionCount) {
if (super.retryMethod(method, exception, executionCount)) {
stats.netRetries++;
return true;
}
return false;
}
});
params.setConnectionManagerTimeout(settings.getHttpTimeout());
params.setSoTimeout((int) settings.getHttpTimeout());
HostConfiguration hostConfig = new HostConfiguration();
hostConfig = setupSSLIfNeeded(settings, hostConfig);
hostConfig = setupSocksProxy(settings, hostConfig);
Object[] authSettings = setupHttpProxy(settings, hostConfig);