uPortal-Project/NewsReaderPortlet

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

Opened this issue · 2 comments

bjagg commented

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

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.