-
Notifications
You must be signed in to change notification settings - Fork 369
Description
Hi,
When using the apache5-connector the use of java system proxies are not working.
The issue is that in the Apache5Connector is does not tell the HttpClientBuilder to turn on the use of system properties via useSystemProperties.
You have the setting for Apache5ClientProperties.USE_SYSTEM_PROPERTIES but when set to true you guys are forgetting to tell the HttpClientBuilder also it needs to use system properties.
This can be achieved by clientBuilder.useSystemProperties()
if (PropertiesHelper.isProperty(config.getProperties(), "jersey.config.apache5.client.useSystemProperties")) {
clientBuilder.useSystemProperties()
}
any where after the HttpClientBuilder clientBuilder = HttpClientBuilder.create(); statement in Apache5Connector.
For now anyone that is trying to use the apache5-connector, use the Apache5HttpClientBuilderConfigurator
Apache5HttpClientBuilderConfigurator apache5HttpClientBuilderConfigurator = (httpClientBuilder) -> {
return httpClientBuilder.useSystemProperties();
};
ClientConfig cc = new ClientConfig();
cc.register(apache5HttpClientBuilderConfigurator);