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

Fix ApacheHttpTransport configuration #717

Merged
merged 2 commits into from Jun 18, 2019

Conversation

chingor13
Copy link
Collaborator

Fixes #715

Switch back to deprecated setStaleConnectionCheck. HttpClientBuilder does not expose a way to configure the connection manager's validateAfterInactivity configuration. We can either reimplement the entirety of the builder's logic or switch back to a deprecated method.

@chingor13 chingor13 requested a review from a team as a code owner June 14, 2019 00:03
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 14, 2019
@chingor13
Copy link
Collaborator Author

@chanseokoh We will backport this into a 1.30.2 release if it fixes the issue.

new PoolingHttpClientConnectionManager(-1, TimeUnit.MILLISECONDS);
// Disable the stale connection check (previously configured in the HttpConnectionParams
connectionManager.setValidateAfterInactivity(-1);

return HttpClientBuilder.create()
.useSystemProperties()
.setSSLSocketFactory(SSLConnectionSocketFactory.getSocketFactory())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you remove this? By default, it will create and use SSLConnectionSocketFactory.getSocketFactory(). If this is set, I can't set .setSSLContext() or .setSSLHostnameVerifier() as they are overridden in the same manner with setConnectionManager().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... that may not exactly be same when useSystemProperties() is set.

Nonetheless, I think I'm OK either way, since I can explicitly unset the factory by .setSSLSocketFactory(null), so not a big deal.

@chanseokoh
Copy link
Contributor

@chingor13 thanks! I'm OK if you make a new release or do a backport. This works in my testing.

@chingor13 chingor13 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 16, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 16, 2019
@chingor13 chingor13 merged commit 88a6548 into googleapis:master Jun 18, 2019
@chingor13 chingor13 deleted the apache-bug branch June 18, 2019 18:31
chingor13 added a commit that referenced this pull request Jun 21, 2019
* Switch back to deprecated setStaleConnectionCheck

* checkstyle fix for TODO
clundin25 pushed a commit to clundin25/google-http-java-client that referenced this pull request Aug 11, 2022
…on URL for Workload Identity Federation (googleapis#717)

* fix: add validation for the token URL and service account impersonation URL in ExternalAccountCredentials

* fix: review comment

* fix: add test case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Apache HttpClient is not properly configured
5 participants