client.getHostConfiguration().setHost(u.getHost(), u.getPort(), new Protocol("https", (ProtocolSocketFactory) new EasySSLProtocolSocketFactory(), 443));
} else {
type = IProxyData.HTTP_PROXY_TYPE;
client.getHostConfiguration().setHost(u.getHost(), u.getPort());
}
IProxyData proxyData = Activator.getDefault().getProxyService().getProxyDataForHost(u.getHost(), type);
if (proxyData != null) {
client.getHostConfiguration().setProxy(proxyData.getHost(), proxyData.getPort());
if (proxyData.isRequiresAuthentication()) {
client.getState().setProxyCredentials(new AuthScope(proxyData.getHost(), proxyData.getPort()),
new UsernamePasswordCredentials(proxyData.getUserId(), proxyData.getPassword()));
}
}
client.getParams().setConnectionManagerTimeout(1000);
client.getParams().setSoTimeout(1000);
return client;