return close;
}
private HostConfiguration getHostConfiguration(String locationURI, MessageExchange exchange, NormalizedMessage message)
throws Exception {
HostConfiguration host;
URI uri = new URI(locationURI, false);
if (uri.getScheme().equals("https")) {
synchronized (this) {
if (protocol == null) {
ProtocolSocketFactory sf = new CommonsHttpSSLSocketFactory(
endpoint.getSsl(),
endpoint.getKeystoreManager());
protocol = new Protocol("https", sf, 443);
}
}
HttpHost httphost = new HttpHost(uri.getHost(), uri.getPort(), protocol);
host = new HostConfiguration();
host.setHost(httphost);
} else {
host = new HostConfiguration();
host.setHost(uri.getHost(), uri.getPort());
}
if (endpoint.getProxy() != null) {
if ((endpoint.getProxy().getProxyHost() != null) && (endpoint.getProxy().getProxyPort() != 0)) {
host.setProxy(endpoint.getProxy().getProxyHost(), endpoint.getProxy().getProxyPort());
}
if (endpoint.getProxy().getProxyCredentials() != null) {
endpoint.getProxy().getProxyCredentials().applyProxyCredentials(getClient(), exchange, message);
}
} else if ((getConfiguration().getProxyHost() != null) && (getConfiguration().getProxyPort() != 0)) {
host.setProxy(getConfiguration().getProxyHost(), getConfiguration().getProxyPort());
}
return host;
}