I have inherited the code
import org.apache.http.client.HttpClient;
...
HttpClient httpclient = createHttpClientOrProxy();
...
private HttpClient createH
This is more of a follow-up to the answer given by @Stephane Lallemagne
There is a much conciser way of making HttpClient pick up system proxy settings
CloseableHttpClient client = HttpClients.custom()
.setRoutePlanner(
new SystemDefaultRoutePlanner(ProxySelector.getDefault()))
.build();
or this if you want an instance of HttpClient fully configured with system defaults
CloseableHttpClient client = HttpClients.createSystem();