-
The currently maintained versions of CPython have support for TLS-in-TLS disabled for |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 11 replies
-
The It is possible to patch the stdlib import asyncio
setattr(asyncio.sslproto._SSLProtocolTransport, "_start_tls_compatible", True) After this, proceed using the proxy as normal. Here's the doc: https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support. Note that this support has only been enabled on the aiohttp side since v3.8. Refs:
|
Beta Was this translation helpful? Give feedback.
-
@webknjaz FYI, This is enabled in 3.11+ and tls in tls works. |
Beta Was this translation helpful? Give feedback.
-
I see this warning in my logs when making an HTTPs request over an HTTP proxy
Looking at the code it seems that even when using an HTTP proxy aiohttp will send the warning https://github.com/aio-libs/aiohttp/blob/v3.8.3/aiohttp/connector.py#L1249. I find that a bit confusing, given I am not using an HTTPS proxy. Why is this warning logged? Am I missing/misunderstanding something? |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
I'm using python3.11 and the last version of aiohttp btw still having the same warning.
|
Beta Was this translation helpful? Give feedback.
This comment has been minimized.
This comment has been minimized.
-
Sometime the underlying transport is not asyncio.sslproto._SSLProtocolTransport and has no "_start_tls_compatible" attribute. So the hack and the check code won't work and warnings is always shown despite it may actually works. One of the cases is uvloop.loop.TCPTransport |
Beta Was this translation helpful? Give feedback.
The
asyncio.loop.start_tls()
is available since Python 3.7. But some of theasyncio
internals don't set an attribute that would enable creating TLS connections encapsulated inside of other TLS connections (at least, not until Python 3.11).It is possible to patch the stdlib
asyncio
to allow this. Add the following monkey-patch in your app and it will work (to the extent of what CPython itself supports):After this, proceed using the proxy as normal. Here's the doc: https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support.
Note that this support has only been enabled on the aiohttp s…