implemented authorization via http proxy

This commit is contained in:
Vyacheslav N. Boyko 2018-04-16 18:01:00 +03:00
parent 378c8aaddc
commit b9c32c55d8

View File

@ -63,22 +63,7 @@ public abstract class DefaultAbsSender extends AbsSender {
this.exe = Executors.newFixedThreadPool(options.getMaxThreads()); this.exe = Executors.newFixedThreadPool(options.getMaxThreads());
this.options = options; this.options = options;
if (options.getCredentialsProvider() != null) { httpclient = createHttpClient();
httpclient = HttpClientBuilder.create()
.setProxy(options.getHttpProxy())
.setProxyAuthenticationStrategy(new ProxyAuthenticationStrategy())
.setDefaultCredentialsProvider(options.getCredentialsProvider())
.setSSLHostnameVerifier(new NoopHostnameVerifier())
.setConnectionTimeToLive(70, TimeUnit.SECONDS)
.setMaxConnTotal(100)
.build();
} else {
httpclient = HttpClientBuilder.create()
.setSSLHostnameVerifier(new NoopHostnameVerifier())
.setConnectionTimeToLive(70, TimeUnit.SECONDS)
.setMaxConnTotal(100)
.build();
}
requestConfig = options.getRequestConfig(); requestConfig = options.getRequestConfig();