- DefaultHttpClient httpClient = new DefaultHttpClient();
- httpClient.addResponseInterceptor(new ResponseContentEncoding());
+ HttpClientBuilder httpClientBuilder = HttpClientBuilder.create()
+ .setSSLHostnameVerifier((hostname, session) -> true)
+ .addInterceptorFirst(new ResponseContentEncoding());
+ if ((proxyHost != null) && (proxyPort != -1)) {
+ httpClientBuilder.setProxy(new HttpHost(proxyHost, proxyPort));
+ }
+ HttpClient httpClient = httpClientBuilder.build();