@Deprecated public static HttpClient create() { final DefaultAsyncHttpClientConfig config = new DefaultAsyncHttpClientConfig.Builder() .setEnabledProtocols(new String[]{"TLSv1.1", "TLSv1.2"}) .setReadTimeout(121000) .setRequestTimeout(121000) .build(); return AsyncHttpClientAdapter.of(new DefaultAsyncHttpClient(config)); }
@Deprecated public static HttpClient create() { /* http://static.javadoc.io/org.asynchttpclient/async-http-client/2.0.0-RC9/org/asynchttpclient/AsyncHttpClientConfig.html */ final DefaultAsyncHttpClientConfig config = new DefaultAsyncHttpClientConfig.Builder() .setEnabledProtocols(new String[]{"TLSv1.1", "TLSv1.2"}) .setReadTimeout(121000) .setRequestTimeout(121000) .build(); return AsyncHttpClientAdapter.of(new DefaultAsyncHttpClient(config)); }
@Deprecated public static HttpClient create() { /* http://static.javadoc.io/org.asynchttpclient/async-http-client/2.0.0-RC9/org/asynchttpclient/AsyncHttpClientConfig.html */ final DefaultAsyncHttpClientConfig config = new DefaultAsyncHttpClientConfig.Builder() .setEnabledProtocols(new String[]{"TLSv1.1", "TLSv1.2"}) .setReadTimeout(121000) .setRequestTimeout(121000) .build(); return AsyncHttpClientAdapter.of(new DefaultAsyncHttpClient(config)); }
config.setConnectionTtl(poolConfiguration.getConnectionTtl()); config.setEnabledProtocols(poolConfiguration.getEnabledProtocols()); config.setEnabledCipherSuites(poolConfiguration.getEnabledCipherSuites());
/** * Creates a {@link HttpClient} that can be used by the {@link SphereClient}. * @return new http client with custom settings */ public static HttpClient createCustomHttpClient() { final AsyncHttpClientConfig httpClientConfig = new DefaultAsyncHttpClientConfig.Builder() .setEnabledProtocols(new String[]{"TLSv1.2"})//required //examples for configuration .setMaxConnections(500) .setConnectTimeout(10000) // .setProxyServer(proxy) .build(); final AsyncHttpClient asyncHttpClient = new DefaultAsyncHttpClient(httpClientConfig); return AsyncHttpClientAdapter.of(asyncHttpClient); }