@Override
public CredentialsProvider extendCredentialProvider(HttpClientBuilder httpClientBuilder,
CredentialsProvider credentialsProvider,
GerritAuthData authData) {
HttpConfigurable proxySettings = HttpConfigurable.getInstance();
IdeaWideProxySelector ideaWideProxySelector = new IdeaWideProxySelector(proxySettings);
// This will always return at least one proxy, which can be the "NO_PROXY" instance.
List<Proxy> proxies = ideaWideProxySelector.select(URI.create(authData.getHost()));
// Find the first real proxy with an address type we support.
for (Proxy proxy : proxies) {
SocketAddress socketAddress = proxy.address();