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

Proxy not working due to signature mismatch #1070

Closed
5 of 6 tasks
MPK1 opened this issue Jan 11, 2024 · 4 comments · Fixed by #1077
Closed
5 of 6 tasks

Proxy not working due to signature mismatch #1070

MPK1 opened this issue Jan 11, 2024 · 4 comments · Fixed by #1077
Assignees
Labels
bug Something isn't working

Comments

@MPK1
Copy link

MPK1 commented Jan 11, 2024

Description

The method _setup_proxy_ssl_context expects a string but is passed a dict here. At the parse_url() call, the connection establishment will fail as the dict cannot be parsed as url and does not even contain the url (which is why I can't think of an easy fix right now).

In commit fbfeb1242ab1f378f6d4fe84b5d3dacdd8874189, the signature was changed but the call was not updated. Reverting the changes applied to _setup_proxy_ssl_context does solve the problem.

In botocore, _setup_proxy_ssl_context is called in the send method where the request is available.

Checklist

  • I have reproduced in environment where pip check passes without errors
  • I have provided pip freeze results
  • I have provided sample code or detailed way to reproduce
  • I have tried reviewed the same code in botocore to ensure this is an aiobotocore specific issue
  • I have tried reviewed similar code in aiohttp to ensure this is is an aiobotocore specific issue
  • I have checked the latest and older versions of aiobotocore/aiohttp/python to see if this is a regression / injection

pip freeze results

aiobotocore==2.9.0
aiohttp==3.9.1
aioitertools==0.11.0
aiosignal==1.3.1
attrs==23.2.0
botocore==1.33.13
certifi==2023.11.17
frozenlist==1.4.1
fsspec==2023.12.2
idna==3.6
jmespath==1.0.1
multidict==6.0.4
python-dateutil==2.8.2
s3fs==2023.12.2
six==1.16.0
urllib3==2.0.7
wrapt==1.16.0
yarl==1.9.4

Environment:

  • Python Version: 3.11.4
  • OS name and version: darwin 14.2.1 (23C71)
@thehesiod
Copy link
Collaborator

thehesiod commented Jan 11, 2024

oh man quite a bit of work (and research) is needed here. Going to take a bit to get to. Welcome to PRs!

@MPK1
Copy link
Author

MPK1 commented Jan 11, 2024

oh man quite a bit of work (and research) is needed here. Going to take a bit to get to. Welcome to PRs!

That's what it also looked like to me...

@thehesiod
Copy link
Collaborator

probably my fault, or bit rot

@jakob-keller
Copy link
Collaborator

Do we even need _setup_proxy_ssl_context?

According to aiohttp documentation:

When supplying a custom ssl.SSLContext instance, bear in mind that it will be used not only to establish a TLS session with the HTTPS endpoint you’re hitting but also to establish a TLS tunnel to the HTTPS proxy. To avoid surprises, make sure to set up the trust chain that would recognize TLS certificates used by both the endpoint and the proxy.

Maybe we should think about ways to merge both TLS configurations into a single SSLContext?

jakob-keller added a commit to jakob-keller/aiobotocore that referenced this issue Jan 19, 2024
@jakob-keller jakob-keller self-assigned this Jan 20, 2024
@jakob-keller jakob-keller added the bug Something isn't working label Jan 20, 2024
jakob-keller added a commit to jakob-keller/aiobotocore that referenced this issue Jan 27, 2024
jakob-keller added a commit to jakob-keller/aiobotocore that referenced this issue Jan 27, 2024
jakob-keller added a commit to jakob-keller/aiobotocore that referenced this issue Feb 3, 2024
jakob-keller added a commit to jakob-keller/aiobotocore that referenced this issue Feb 3, 2024
jakob-keller added a commit to jakob-keller/aiobotocore that referenced this issue Feb 28, 2024
jakob-keller added a commit to jakob-keller/aiobotocore that referenced this issue Feb 28, 2024
jakob-keller added a commit to jakob-keller/aiobotocore that referenced this issue Mar 1, 2024
jakob-keller added a commit to jakob-keller/aiobotocore that referenced this issue Mar 4, 2024
thehesiod pushed a commit that referenced this issue Mar 4, 2024
* fix use of proxies #1070
* use `contextlib.AsyncExitStack` to simplify proxy session handling in `AIOHTTPSession`
* extract session creation into `AIOHTTPSession._get_session()`
* extract `chunked` detection into `AIOHTTPSession._chunked()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants