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

IPv6 in URL is missing brackets in proxy CONNECT request #3841

Closed
shnavid-zz opened this issue Jun 13, 2019 · 1 comment
Closed

IPv6 in URL is missing brackets in proxy CONNECT request #3841

shnavid-zz opened this issue Jun 13, 2019 · 1 comment
Labels
needs-info Issue is lacking sufficient information and will be closed if not provided Stale

Comments

@shnavid-zz
Copy link
Contributor

Long story short

Requests to a URL containing an IPv6 address while using a proxy results in a malformed CONNECT request.

Expected behaviour

The request should make it through the proxy and reach the IPv6 server.

Actual behaviour

The proxy is returning an error (400, Bad request).

Steps to reproduce

async with aiohttp.request(
  'get',
  'https://[2320:10a:c081:56::363]:443/testing.txt',
   proxy="http://whatever:8080",
 ) as response:
     print(response)

tcpdump shows (notice the missing brackets):

CONNECT 2320:10a:c081:56::363:443 HTTP/1.1
Host: [2320:10a:c081:56::363]
Accept: */*
Accept-Encoding: gzip, deflate
User-Agent: Python/3.6 aiohttp/3.5.4

I patched https://github.com/aio-libs/aiohttp/blob/master/aiohttp/client_reqrep.py#L543 to add the brackets and confirmed that the request is going through.

Your environment

aiohttp/3.5.4 (client)
CentOS 7.5

@Dreamsorcerer
Copy link
Member

I think there have been some fixes for IPv6, can you retest on the latest release?

@Dreamsorcerer Dreamsorcerer added the needs-info Issue is lacking sufficient information and will be closed if not provided label Aug 12, 2024
@github-actions github-actions bot added the Stale label Sep 12, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Issue is lacking sufficient information and will be closed if not provided Stale
Projects
None yet
Development

No branches or pull requests

2 participants