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

Upgrade of HttpClient breaks passing in http.proxyHost and http.proxyPort #379

Open
bjagg opened this issue Sep 15, 2023 · 2 comments
Open

Comments

@bjagg
Copy link
Member

bjagg commented Sep 15, 2023

It looks like HttpClient requires a call now in the builder to pick up System properties. I suggest adding the following to your overrides context:

    <bean id="httpClientBuilder" class="org.apache.http.impl.client.HttpClientBuilder"
          factory-method="create">
          <property name="defaultRequestConfig" ref="requestConfig" />
          <property name="retryHandler" ref="retryHandler" />
          <property name="SSLSocketFactory" ref="sslSocketFactory" />
    </bean>

    <bean id="systemHttpClientBuilder" factory-bean="httpClientBuilder" 
          factory-method="useSystemProperties"/>

    <bean id="httpClient" factory-bean="systemHttpClientBuilder" factory-method="build" />

You may need to move the property nodes from the httpClientBuilder to the systemHttpClientBuilder.

If you get it to work, please let us know or submit a PR.

Thanks!
-bjagg

@bjagg
Copy link
Member Author

bjagg commented Sep 15, 2023

@ITassas
Copy link

ITassas commented Feb 12, 2024

With suggested overrides context, issue is still here because deprecated httpClient.getParams() is called ( init from RomeAdapater code ) when http.proxyHost and http.proxyPort are set by JVM options.

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

No branches or pull requests

2 participants