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

support for TLS in TLS Warning #8

Open
KRRT7 opened this issue Nov 5, 2023 · 2 comments
Open

support for TLS in TLS Warning #8

KRRT7 opened this issue Nov 5, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@KRRT7
Copy link

KRRT7 commented Nov 5, 2023

using aiohttp with an http proxy with an https request shows an
path\to\venv\Lib\site-packages\aiohttp\connector.py:899: RuntimeWarning: An HTTPS request is being sent through an HTTPS proxy. This support for TLS in TLS is known to be disabled in the stdlib asyncio. This is why you'll probably see an error in the log below.
this warning only shows when i install the winloop event policy

import winloop
import aiohttp
import asyncio


async def make_request():
    async with aiohttp.ClientSession() as session:
        async with session.get("https://www.google.com", proxy="http://ip:port") as response:
            print(response.status)


if __name__ == "__main__":
    winloop.install()
    asyncio.run(make_request())

if i comment out the winloop.install() then i don't get the error with the same code
image
image

@Vizonex
Copy link
Owner

Vizonex commented Nov 11, 2023

@KevinRodriguez777 There is aiohttp_socks as a workaround to this problem. But from what you've shown me, this is definitely something that either you or I should be bringing up with the developers of aiohttp I will look more into this a bit later when I have the time to.

@Vizonex
Copy link
Owner

Vizonex commented Nov 11, 2023

import winloop
from aiohttp_socks import ProxyConnector
import aiohttp
import asyncio


async def make_request():
    async with aiohttp.ClientSession(connector=ProxyConnector.from_url("http://ip:port")) as session:
        async with session.get("https://www.google.com") as response:
            print(response.status)


if __name__ == "__main__":
    winloop.install()
    asyncio.run(make_request())

here's what I was suggesting you do for now until I can figure out exactly as to why this warning appears.

@Vizonex Vizonex added the bug Something isn't working label Nov 11, 2023
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

No branches or pull requests

2 participants