use of com.ning.http.client.ProxyServer in project sonatype-aether by sonatype.
the class AsyncRepositoryConnector method getProxy.
private ProxyServer getProxy(RemoteRepository repository, String credentialEncoding) {
ProxyServer proxyServer = null;
Proxy p = repository.getProxy();
if (p != null) {
Authentication a = p.getAuthentication();
boolean useSSL = repository.getProtocol().equalsIgnoreCase("https") || repository.getProtocol().equalsIgnoreCase("dav:https");
if (a == null) {
proxyServer = new ProxyServer(useSSL ? Protocol.HTTPS : Protocol.HTTP, p.getHost(), p.getPort());
} else {
proxyServer = new ProxyServer(useSSL ? Protocol.HTTPS : Protocol.HTTP, p.getHost(), p.getPort(), a.getUsername(), a.getPassword());
proxyServer.setEncoding(credentialEncoding);
}
}
return proxyServer;
}
Aggregations