Adopt requests new get_connection API#164
Merged
pquentin merged 6 commits intoelastic:mainfrom May 28, 2024
Merged
Conversation
| # elastic-transport is not vulnerable to CVE-2024-35195 because it uses | ||
| # requests.Session and an SSLContext without using the verify parameter. | ||
| # We should remove this branch when requiring requests 2.32 or later. | ||
| adapter.get_connection(self.base_url) |
Contributor
There was a problem hiding this comment.
Do we need to preserve the type: ignore here? And are there any typing considerations for the new call?
Member
Author
There was a problem hiding this comment.
We don't, the types were fixed in typeshed yesterday: python/typeshed#12000.
miguelgrinberg
approved these changes
May 23, 2024
Member
Author
|
Yes, we should probably test using an older version of requests too. Waiting for requests 2.32.3 to proceed further here. |
Member
Author
|
The remaining failure is due to psf/requests#6716. It will go away when requests 2.32.3 is released. |
Member
Author
|
I'm merging this now because it improves the situation and I checked that the tests pass with the main branch of requests, which should be released any time now: psf/requests#6721. |
github-actions bot
pushed a commit
that referenced
this pull request
May 28, 2024
* Fix requests 2.32 compatibility * Test minimum dependencies in CI (cherry picked from commit d89e9f0)
github-actions bot
pushed a commit
that referenced
this pull request
May 28, 2024
* Fix requests 2.32 compatibility * Test minimum dependencies in CI (cherry picked from commit d89e9f0)
pquentin
added a commit
that referenced
this pull request
May 28, 2024
pquentin
added a commit
that referenced
this pull request
May 28, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To fix a security vulnerability, requests removed
HTTPAdapter.get_connection()in favor ofHTTPAdapter.get_connection_with_tls_context(). This breaks the transport and client when using requests 2.32 or later, as the transport directly calls the removed API. This pull request fixes the issue.See psf/requests#6710 for more details.