public JavaHttpBuilder(final HttpObjectConfig config) { super(config); this.config = new HttpConfigs.ThreadSafeHttpConfig(config.getChainedConfig()); this.executor = config.getExecution().getExecutor(); this.sslContext = config.getExecution().getSslContext(); this.clientConfig = config.getClient(); }
this.config = new HttpConfigs.ThreadSafeHttpConfig(config.getChainedConfig()); this.executor = config.getExecution().getExecutor(); this.clientConfig = config.getClient();
this.config = new HttpConfigs.ThreadSafeHttpConfig(config.getChainedConfig()); this.executor = config.getExecution().getExecutor(); this.clientConfig = config.getClient();
protected JavaHttpBuilder(final HttpObjectConfig config) { super(config); this.config = new HttpConfigs.ThreadSafeHttpConfig(config.getChainedConfig()); this.executor = config.getExecution().getExecutor(); this.clientConfig = config.getClient(); this.hostnameVerifier = config.getExecution().getHostnameVerifier(); this.sslContext = config.getExecution().getSslContext(); this.proxyInfo = config.getExecution().getProxyInfo(); }
protected JavaHttpBuilder(final HttpObjectConfig config) { super(config); this.config = new HttpConfigs.ThreadSafeHttpConfig(config.getChainedConfig()); this.executor = config.getExecution().getExecutor(); this.clientConfig = config.getClient(); this.hostnameVerifier = config.getExecution().getHostnameVerifier(); this.sslContext = config.getExecution().getSslContext(); this.proxyInfo = config.getExecution().getProxyInfo(); }
protected OkHttpBuilder(final HttpObjectConfig config) { super(config); this.config = new HttpConfigs.ThreadSafeHttpConfig(config.getChainedConfig()); this.clientConfig = config.getClient(); this.executor = config.getExecution().getExecutor(); final OkHttpClient.Builder builder = new OkHttpClient.Builder(); final SSLContext sslContext = config.getExecution().getSslContext(); if (sslContext != null) { builder.sslSocketFactory(sslContext.getSocketFactory()/*, (X509TrustManager) TRUST_MANAGERS[0]*/); builder.hostnameVerifier(config.getExecution().getHostnameVerifier()); } // DIGEST support - defining this here only allows DIGEST config on the HttpBuilder configuration, not for individual methods. final HttpConfig.Auth auth = config.getRequest().getAuth(); if (auth != null && auth.getAuthType() == DIGEST) { Map<String, CachingAuthenticator> authCache = new ConcurrentHashMap<>(); builder.addInterceptor(new AuthenticationCacheInterceptor(authCache)); builder.authenticator(new CachingAuthenticatorDecorator( new DigestAuthenticator(new com.burgstaller.okhttp.digest.Credentials(auth.getUser(), auth.getPassword())), authCache) ); } final Consumer<Object> clientCustomizer = clientConfig.getClientCustomizer(); if (clientCustomizer != null) { clientCustomizer.accept(builder); } final ProxyInfo pinfo = config.getExecution().getProxyInfo(); if (usesProxy(pinfo)) { builder.proxy(pinfo.getProxy()); } this.client = builder.build(); }