public SSLContext getSSLContext(AsyncHttpClientConfig config) throws GeneralSecurityException { SSLContext sslContext = config.getSSLContext(); if (sslContext == null) { sslContext = config.isAcceptAnyCertificate() ? looseTrustManagerSSLContext : SSLContext.getDefault(); if (config.getSslSessionCacheSize() != null) sslContext.getClientSessionContext().setSessionCacheSize(config.getSslSessionCacheSize()); if (config.getSslSessionTimeout() != null) sslContext.getClientSessionContext().setSessionTimeout(config.getSslSessionTimeout()); } return sslContext; } }
realm = prototype.getRealm(); requestTimeout = prototype.getRequestTimeout(); sslContext = prototype.getSSLContext(); userAgent = prototype.getUserAgent(); followRedirect = prototype.isFollowRedirect();
final boolean defaultSecState = (clientConfig.getSSLContext() != null); final SSLEngineConfigurator configurator = new AhcSSLEngineConfigurator(
private HttpURLConnection createUrlConnection(Request request) throws IOException, URISyntaxException { ProxyServer proxyServer = ProxyUtils.getProxyServer(config, request); Realm realm = request.getRealm() != null ? request.getRealm() : config.getRealm(); Proxy proxy = null; if (proxyServer != null || realm != null) { try { proxy = configureProxyAndAuth(proxyServer, realm); } catch (AuthenticationException e) { throw new IOException(e.getMessage()); } } HttpURLConnection urlConnection = (HttpURLConnection) request.getURI().toURI().toURL().openConnection(proxy == null ? Proxy.NO_PROXY : proxy); if (request.getURI().getScheme().equals("https")) { HttpsURLConnection secure = (HttpsURLConnection) urlConnection; SSLContext sslContext = config.getSSLContext(); if (sslContext == null) { try { sslContext = SslUtils.getInstance().getSSLContext(config.isAcceptAnyCertificate()); } catch (NoSuchAlgorithmException e) { throw new IOException(e.getMessage()); } catch (GeneralSecurityException e) { throw new IOException(e.getMessage()); } } secure.setSSLSocketFactory(sslContext.getSocketFactory()); secure.setHostnameVerifier(config.getHostnameVerifier()); } return urlConnection; }
public SslHandler createSslHandler(String peerHost, int peerPort) throws GeneralSecurityException, IOException { SSLEngine sslEngine = null; if (nettyConfig.getSslEngineFactory() != null) { sslEngine = nettyConfig.getSslEngineFactory().newSSLEngine(); } else { SSLContext sslContext = config.getSSLContext(); if (sslContext == null) sslContext = SslUtils.getInstance().getSSLContext(config.isAcceptAnyCertificate()); sslEngine = sslContext.createSSLEngine(peerHost, peerPort); sslEngine.setUseClientMode(true); } return handshakeTimeout > 0 ? new SslHandler(sslEngine, getDefaultBufferPool(), false, nettyTimer, handshakeTimeout) : new SslHandler(sslEngine); }
public SSLContext getSSLContext(AsyncHttpClientConfig config) throws GeneralSecurityException { SSLContext sslContext = config.getSSLContext(); if (sslContext == null) { sslContext = config.isAcceptAnyCertificate() ? looseTrustManagerSSLContext : SSLContext.getDefault(); if (config.getSslSessionCacheSize() != null) sslContext.getClientSessionContext().setSessionCacheSize(config.getSslSessionCacheSize()); if (config.getSslSessionTimeout() != null) sslContext.getClientSessionContext().setSessionTimeout(config.getSslSessionTimeout()); } return sslContext; } }
public SSLContext getSSLContext(AsyncHttpClientConfig config) throws GeneralSecurityException { SSLContext sslContext = config.getSSLContext(); if (sslContext == null) { sslContext = config.isAcceptAnyCertificate() ? looseTrustManagerSSLContext : SSLContext.getDefault(); if (config.getSslSessionCacheSize() != null) sslContext.getClientSessionContext().setSessionCacheSize(config.getSslSessionCacheSize()); if (config.getSslSessionTimeout() != null) sslContext.getClientSessionContext().setSessionTimeout(config.getSslSessionTimeout()); } return sslContext; } }
realm = prototype.getRealm(); requestTimeout = prototype.getRequestTimeout(); sslContext = prototype.getSSLContext(); userAgent = prototype.getUserAgent(); followRedirect = prototype.isFollowRedirect();
realm = prototype.getRealm(); requestTimeout = prototype.getRequestTimeout(); sslContext = prototype.getSSLContext(); userAgent = prototype.getUserAgent(); followRedirect = prototype.isFollowRedirect();
realm = prototype.getRealm(); requestTimeout = prototype.getRequestTimeout(); sslContext = prototype.getSSLContext(); userAgent = prototype.getUserAgent(); followRedirect = prototype.isFollowRedirect();
SSLContext context = clientConfig.getSSLContext(); boolean defaultSecState = (context != null); if (context == null) {
final boolean defaultSecState = (clientConfig.getSSLContext() != null); final SSLEngineConfigurator configurator = new AhcSSLEngineConfigurator(
final boolean defaultSecState = (clientConfig.getSSLContext() != null); final SSLEngineConfigurator configurator = new AhcSSLEngineConfigurator(