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

Use loop.starttls() on Python 3.7+ #4268

Closed
asvetlov opened this issue Oct 25, 2019 · 7 comments · Fixed by #5992
Closed

Use loop.starttls() on Python 3.7+ #4268

asvetlov opened this issue Oct 25, 2019 · 7 comments · Fixed by #5992
Labels
Milestone

Comments

@asvetlov
Copy link
Member

Now TCPConnector has a custom code for upgrading proxy from HTTP to HTTPS on CONNECT http verb.

I think we should start using loop.starttls() on Python 3.7+ to fix the issue.

Originally posted by @asvetlov in #2245 (comment)

@rookiemann
Copy link

@asvetlov Hello sir.

I was wondering what you are referring to with loop.starttls()? Do you think this something that can help my current issue here? This is my comment link in the issues thread for aiohttp.

#4429 (comment)

I have been getting some help:
https://pastebin.com/atLw1hC7
image

I'd really like to get this working, I'm not sure if this is a problem on my end and how to remedy it.

Thanks

@Allexio
Copy link

Allexio commented Apr 28, 2020

Hi is there any update on this issue? Any planned upgrade to fix the fact that http proxies don't work anymore on windows?
This is a problem for me because it breaks the slackclient library when using a proxy :/
( slackapi/python-slack-sdk#642 )

@asvetlov asvetlov added this to the 4.0 milestone Nov 23, 2020
@asvetlov
Copy link
Member Author

asvetlov commented Nov 23, 2020

It will be possible starting from aiohttp 4.0 only at least.
loop,starttls() doesn't work together with our home-made workaround.

@rookiemann
Copy link

rookiemann commented Nov 23, 2020 via email

@munding
Copy link

munding commented Jul 28, 2021

python 3.9 there are still such problem

webknjaz added a commit to bmbouter/aiohttp that referenced this issue Oct 5, 2021
Resolves aio-libs#3816
Resolves aio-libs#4268

Co-Authored-By: Brian Bouterse <[email protected]>
Co-Authored-By: Jordan Borean <[email protected]>
Co-Authored-By: Sviatoslav Sydorenko <[email protected]>
webknjaz added a commit to bmbouter/aiohttp that referenced this issue Oct 5, 2021
Resolves aio-libs#3816
Resolves aio-libs#4268

Co-Authored-By: Brian Bouterse <[email protected]>
Co-Authored-By: Jordan Borean <[email protected]>
Co-Authored-By: Sviatoslav Sydorenko <[email protected]>
webknjaz added a commit to bmbouter/aiohttp that referenced this issue Oct 5, 2021
This patch opens up the code path and adds the implementation that
allows end-users to start sending HTTPS requests through
HTTPS proxies.

The support for TLS-in-TLS (needed for this to work) in the stdlib is
kinda available since Python 3.7 but is disabled for `asyncio` with an
attribute/flag/toggle. When the upstream CPython enables it finally,
aiohttp v3.8+ will be able to work with it out of the box.

Currently the tests monkey-patch `asyncio` in order to verify that
this works. The users who are willing to do the same, will be able to
take advantage of it right now. Eventually (hopefully starting Python
3.11), the need for monkey-patching should be eliminated.

Refs:
* https://bugs.python.org/issue37179
* python/cpython#28073
* https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support
* aio-libs#6044

Resolves aio-libs#3816
Resolves aio-libs#4268

Co-Authored-By: Brian Bouterse <[email protected]>
Co-Authored-By: Jordan Borean <[email protected]>
Co-Authored-By: Sviatoslav Sydorenko <[email protected]>
webknjaz added a commit to bmbouter/aiohttp that referenced this issue Oct 5, 2021
This patch opens up the code path and adds the implementation that
allows end-users to start sending HTTPS requests through
HTTPS proxies.

The support for TLS-in-TLS (needed for this to work) in the stdlib is
kinda available since Python 3.7 but is disabled for `asyncio` with an
attribute/flag/toggle. When the upstream CPython enables it finally,
aiohttp v3.8+ will be able to work with it out of the box.

Currently the tests monkey-patch `asyncio` in order to verify that
this works. The users who are willing to do the same, will be able to
take advantage of it right now. Eventually (hopefully starting Python
3.11), the need for monkey-patching should be eliminated.

Refs:
* https://bugs.python.org/issue37179
* python/cpython#28073
* https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support
* aio-libs#6044

Resolves aio-libs#3816
Resolves aio-libs#4268

Co-Authored-By: Brian Bouterse <[email protected]>
Co-Authored-By: Jordan Borean <[email protected]>
Co-Authored-By: Sviatoslav Sydorenko <[email protected]>
webknjaz added a commit that referenced this issue Oct 5, 2021
This patch opens up the code path and adds the implementation that
allows end-users to start sending HTTPS requests through
HTTPS proxies.

The support for TLS-in-TLS (needed for this to work) in the stdlib is
kinda available since Python 3.7 but is disabled for `asyncio` with an
attribute/flag/toggle. When the upstream CPython enables it finally,
aiohttp v3.8+ will be able to work with it out of the box.

Currently the tests monkey-patch `asyncio` in order to verify that
this works. The users who are willing to do the same, will be able to
take advantage of it right now. Eventually (hopefully starting Python
3.11), the need for monkey-patching should be eliminated.

Refs:
* https://bugs.python.org/issue37179
* python/cpython#28073
* https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support
* #6044

PR #5992
Resolves #3816
Resolves #4268

Co-authored-by: Brian Bouterse <[email protected]>
Co-authored-by: Jordan Borean <[email protected]>
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
webknjaz pushed a commit to webknjaz/aiohttp that referenced this issue Oct 5, 2021
This patch opens up the code path and adds the implementation that
allows end-users to start sending HTTPS requests through
HTTPS proxies.

The support for TLS-in-TLS (needed for this to work) in the stdlib is
kinda available since Python 3.7 but is disabled for `asyncio` with an
attribute/flag/toggle. When the upstream CPython enables it finally,
aiohttp v3.8+ will be able to work with it out of the box.

Currently the tests monkey-patch `asyncio` in order to verify that
this works. The users who are willing to do the same, will be able to
take advantage of it right now. Eventually (hopefully starting Python
3.11), the need for monkey-patching should be eliminated.

Refs:
* https://bugs.python.org/issue37179
* python/cpython#28073
* https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support
* aio-libs#6044

PR aio-libs#5992
Resolves aio-libs#3816
Resolves aio-libs#4268

Co-authored-by: Brian Bouterse <[email protected]>
Co-authored-by: Jordan Borean <[email protected]>
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
(cherry picked from commit c29e5fb)
webknjaz pushed a commit to webknjaz/aiohttp that referenced this issue Oct 5, 2021
This patch opens up the code path and adds the implementation that
allows end-users to start sending HTTPS requests through
HTTPS proxies.

The support for TLS-in-TLS (needed for this to work) in the stdlib is
kinda available since Python 3.7 but is disabled for `asyncio` with an
attribute/flag/toggle. When the upstream CPython enables it finally,
aiohttp v3.8+ will be able to work with it out of the box.

Currently the tests monkey-patch `asyncio` in order to verify that
this works. The users who are willing to do the same, will be able to
take advantage of it right now. Eventually (hopefully starting Python
3.11), the need for monkey-patching should be eliminated.

Refs:
* https://bugs.python.org/issue37179
* python/cpython#28073
* https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support
* aio-libs#6044

PR aio-libs#5992
Resolves aio-libs#3816
Resolves aio-libs#4268

Co-authored-by: Brian Bouterse <[email protected]>
Co-authored-by: Jordan Borean <[email protected]>
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
(cherry picked from commit c29e5fb)
webknjaz pushed a commit to webknjaz/aiohttp that referenced this issue Oct 11, 2021
This patch opens up the code path and adds the implementation that
allows end-users to start sending HTTPS requests through
HTTPS proxies.

The support for TLS-in-TLS (needed for this to work) in the stdlib is
kinda available since Python 3.7 but is disabled for `asyncio` with an
attribute/flag/toggle. When the upstream CPython enables it finally,
aiohttp v3.8+ will be able to work with it out of the box.

Currently the tests monkey-patch `asyncio` in order to verify that
this works. The users who are willing to do the same, will be able to
take advantage of it right now. Eventually (hopefully starting Python
3.11), the need for monkey-patching should be eliminated.

Refs:
* https://bugs.python.org/issue37179
* python/cpython#28073
* https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support
* aio-libs#6044

PR aio-libs#5992
Resolves aio-libs#3816
Resolves aio-libs#4268

Co-authored-by: Brian Bouterse <[email protected]>
Co-authored-by: Jordan Borean <[email protected]>
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
(cherry picked from commit c29e5fb)
webknjaz pushed a commit to webknjaz/aiohttp that referenced this issue Oct 12, 2021
This patch opens up the code path and adds the implementation that
allows end-users to start sending HTTPS requests through
HTTPS proxies.

The support for TLS-in-TLS (needed for this to work) in the stdlib is
kinda available since Python 3.7 but is disabled for `asyncio` with an
attribute/flag/toggle. When the upstream CPython enables it finally,
aiohttp v3.8+ will be able to work with it out of the box.

Currently the tests monkey-patch `asyncio` in order to verify that
this works. The users who are willing to do the same, will be able to
take advantage of it right now. Eventually (hopefully starting Python
3.11), the need for monkey-patching should be eliminated.

Refs:
* https://bugs.python.org/issue37179
* python/cpython#28073
* https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support
* aio-libs#6044

PR aio-libs#5992
Resolves aio-libs#3816
Resolves aio-libs#4268

Co-authored-by: Brian Bouterse <[email protected]>
Co-authored-by: Jordan Borean <[email protected]>
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
(cherry picked from commit c29e5fb)
webknjaz added a commit that referenced this issue Oct 12, 2021
…ent (#6049)

This patch opens up the code path and adds the implementation that
allows end-users to start sending HTTPS requests through
HTTPS proxies.

The support for TLS-in-TLS (needed for this to work) in the stdlib is
kinda available since Python 3.7 but is disabled for `asyncio` with an
attribute/flag/toggle. When the upstream CPython enables it finally,
aiohttp v3.8+ will be able to work with it out of the box.

Currently the tests monkey-patch `asyncio` in order to verify that
this works. The users who are willing to do the same, will be able to
take advantage of it right now. Eventually (hopefully starting Python
3.11), the need for monkey-patching should be eliminated.

Refs:
* bugs.python.org/issue37179
* python/cpython#28073
* docs.aiohttp.org/en/stable/client_advanced.html#proxy-support
* #6044

PR #5992
Resolves #3816
Resolves #4268

Co-authored-by: Brian Bouterse <[email protected]>
Co-authored-by: Jordan Borean <[email protected]>
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
@HMaker
Copy link

HMaker commented Oct 14, 2021

@webknjaz I tried using HTTP proxy with aiohttp 3.7.4 and ProactorEventLoop on Windows 10 but it faiils with OSError(22, 'The parameter is incorrect', None, 87, None)) on proxy connection. Same error reported by #2245.

@webknjaz
Copy link
Member

This has been implemented and will be available with hacks under aiohttp 3.8+ (and Python 3.7+). The 3.7 stream is EOL and will not get any updates.

y-young added a commit to y-young/nazurin that referenced this issue Nov 10, 2021
No special handling needed for Windows since aiohttp 3.8 release
aio-libs/aiohttp#4268
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants