Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apache 5 Proxy Issue #5199

Closed
just2evil opened this issue Nov 17, 2022 · 2 comments · Fixed by #5251
Closed

Apache 5 Proxy Issue #5199

just2evil opened this issue Nov 17, 2022 · 2 comments · Fixed by #5251
Milestone

Comments

@just2evil
Copy link

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);

@jansupol
Copy link
Contributor

@just2evil Thank you for reporting this. Feel free to create a PR if you know what is wrong.

@jansupol
Copy link
Contributor

If you are not familiar with the Eclipse processes, make sure you have your account registered with Eclipse. For more see our wiki.

@jansupol jansupol linked a pull request Feb 2, 2023 that will close this issue
@senivam senivam added this to the 2.39 milestone Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants