public EurekaJersey2Client build() { MyDefaultApacheHttpClient4Config config = new MyDefaultApacheHttpClient4Config(); try { return new EurekaJersey2ClientImpl( connectionTimeout, readTimeout, connectionIdleTimeout, config); } catch (Throwable e) { throw new RuntimeException("Cannot create Jersey client ", e); } }
cm = createSystemSslCM(); } else if (trustStoreFileName != null) { cm = createCustomSslCM(); } else { cm = new PoolingHttpClientConnectionManager(); addProxyConfiguration(); register(discoveryJerseyProvider); property(ApacheClientProperties.CONNECTION_MANAGER, cm); property(CoreProtocolPNames.USER_AGENT, fullUserAgentName); property(ClientProperties.FOLLOW_REDIRECTS, Boolean.FALSE); property(ClientPNames.HANDLE_REDIRECTS, Boolean.FALSE);
cm = createSystemSslCM(); } else if (trustStoreFileName != null) { cm = createCustomSslCM(); } else { cm = new PoolingHttpClientConnectionManager(); addProxyConfiguration(); register(discoveryJerseyProvider); property(ApacheClientProperties.CONNECTION_MANAGER, cm); property(CoreProtocolPNames.USER_AGENT, fullUserAgentName); property(ClientProperties.FOLLOW_REDIRECTS, Boolean.FALSE); property(ClientPNames.HANDLE_REDIRECTS, Boolean.FALSE);
private void addProxyConfiguration() { if (proxyUserName != null && proxyPassword != null) { property(ClientProperties.PROXY_USERNAME, proxyUserName); property(ClientProperties.PROXY_PASSWORD, proxyPassword); } else { // Due to bug in apache client, user name/password must always be set. // Otherwise proxy configuration is ignored. property(ClientProperties.PROXY_USERNAME, "guest"); property(ClientProperties.PROXY_PASSWORD, "guest"); } property(ClientProperties.PROXY_URI, "http://" + proxyHost + ":" + proxyPort); }
public EurekaJersey2Client build() { MyDefaultApacheHttpClient4Config config = new MyDefaultApacheHttpClient4Config(); try { return new EurekaJersey2ClientImpl( connectionTimeout, readTimeout, connectionIdleTimeout, config); } catch (Throwable e) { throw new RuntimeException("Cannot create Jersey client ", e); } }
private void addProxyConfiguration() { if (proxyUserName != null && proxyPassword != null) { property(ClientProperties.PROXY_USERNAME, proxyUserName); property(ClientProperties.PROXY_PASSWORD, proxyPassword); } else { // Due to bug in apache client, user name/password must always be set. // Otherwise proxy configuration is ignored. property(ClientProperties.PROXY_USERNAME, "guest"); property(ClientProperties.PROXY_PASSWORD, "guest"); } property(ClientProperties.PROXY_URI, "http://" + proxyHost + ":" + proxyPort); }