use of org.apache.http.impl.conn.PoolingClientConnectionManager in project tdi-studio-se by Talend.
the class RestClient method getConnectionManager.
private static PoolingClientConnectionManager getConnectionManager() {
PoolingClientConnectionManager conMan = new PoolingClientConnectionManager(SchemeRegistryFactory.createDefault());
conMan.setMaxTotal(200);
conMan.setDefaultMaxPerRoute(200);
return conMan;
}
use of org.apache.http.impl.conn.PoolingClientConnectionManager in project oxAuth by GluuFederation.
the class UmaMultithreadTest method before.
@BeforeClass
public void before() {
ClientConnectionManager connectoinManager = new PoolingClientConnectionManager();
final DefaultHttpClient defaultHttpClient = new DefaultHttpClient(connectoinManager);
final ApacheHttpClient4Executor clientExecutor = new ApacheHttpClient4Executor(defaultHttpClient);
String url = serverUri + "/oxauth/seam/resource/restv1/oxauth/uma-configuration";
service = UmaClientFactory.instance().createMetaDataConfigurationService(url, clientExecutor);
}
use of org.apache.http.impl.conn.PoolingClientConnectionManager in project oxAuth by GluuFederation.
the class HttpService method getHttpsClientTrustAll.
public HttpClient getHttpsClientTrustAll() {
try {
SSLSocketFactory sf = new SSLSocketFactory(new TrustStrategy() {
@Override
public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
return true;
}
}, new AllowAllHostnameVerifier());
PlainSocketFactory psf = PlainSocketFactory.getSocketFactory();
SchemeRegistry registry = new SchemeRegistry();
registry.register(new Scheme("http", 80, psf));
registry.register(new Scheme("https", 443, sf));
ClientConnectionManager ccm = new PoolingClientConnectionManager(registry);
return new DefaultHttpClient(ccm);
} catch (Exception ex) {
log.error("Failed to create TrustAll https client", ex);
return new DefaultHttpClient();
}
}
use of org.apache.http.impl.conn.PoolingClientConnectionManager in project coprhd-controller by CoprHD.
the class RenderProxy method createClientConnectionManager.
private static ClientConnectionManager createClientConnectionManager() {
SchemeRegistry schemeRegistry = SchemeRegistryFactory.createDefault();
SSLSocketFactory sf;
if (StorageOsPlugin.isEnabled()) {
try {
// initialize an SSLContext with the vipr keystore and trustmanager.
// This is basically a dup of most of the ViPRSSLSocketFactory constructor,
// and could be extracted
X509TrustManager[] trustManagers = { BourneUtil.getTrustManager() };
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
kmf.init(BourneUtil.getKeyStore(), "".toCharArray());
SSLContext context = SSLContext.getInstance("TLS");
context.init(kmf.getKeyManagers(), trustManagers, new SecureRandom());
sf = new SSLSocketFactory(context, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
} catch (Exception e) {
throw new RuntimeException("Unable to initialize the ViPRX509TrustManager for RenderProxy", e);
}
} else {
sf = new SSLSocketFactory(SSLUtil.getTrustAllContext(), SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
}
Scheme httpsScheme = new Scheme("https", 443, sf);
schemeRegistry.register(httpsScheme);
ClientConnectionManager connectionManager = new PoolingClientConnectionManager(schemeRegistry);
return connectionManager;
}
use of org.apache.http.impl.conn.PoolingClientConnectionManager in project iaf by ibissource.
the class WebServiceNtlmSender method open.
public void open() {
connectionManager = new PoolingClientConnectionManager();
connectionManager.setMaxTotal(getMaxConnections());
}
Aggregations