localConnectionManager.setMaxTotal(1);
SSLSocketFactory myFactory;
if (keystoreManager != null)
{
myFactory = new SSLSocketFactory(keystoreManager.getSecureSocketFactory(),
new AllowAllHostnameVerifier());
}
else
{
// Use the "trust everything" one
myFactory = new SSLSocketFactory(KeystoreManagerFactory.getTrustingSecureSocketFactory(),
new AllowAllHostnameVerifier());
}
Scheme myHttpsProtocol = new Scheme("https", 443, myFactory);
localConnectionManager.getSchemeRegistry().register(myHttpsProtocol);
connectionManager = localConnectionManager;