if (uri.getScheme().equals("https")) {
ProtocolSocketFactory sf = new CommonsHttpSSLSocketFactory(
endpoint.getSsl(),
endpoint.getKeystoreManager());
Protocol protocol = new Protocol("https", sf, 443);
HttpHost host = new HttpHost(uri.getHost(), uri.getPort(), protocol);
this.host = new HostConfiguration();
this.host.setHost(host);
} else {
this.host = new HostConfiguration();
this.host.setHost(uri.getHost(), uri.getPort());