httpx
httpx copied to clipboard
SSL: WRONG_VERSION_NUMBER
Checklist
- [ ] The bug is reproducible against the latest release and/or
master. - [ ] There are no similar issues or pull requests to fix it yet.
Describe the bug
Code
def main(): auth_login = 'test1' auth_password = 'test2' proxy_headers = { "Authorization": generate_basic_header(auth_login, auth_password), "Client": 'CLIENT_HERE', "Connection": 'keep-alive', "Server-Name": 'httpbin.org', "Host": 'IP_HERE', "Secure": '1', "HTTP2": '1', } proxy_url = 'http://IP:PORT' proxy_mode = 'TUNNEL_ONLY' timeout = Timeout(read=10, connect=5, timeout=5) proxy = Proxy(url=proxy_url, headers=proxy_headers, mode=proxy_mode) with Client(http2=True, verify=False, proxies=proxy, timeout=timeout) as client: request_url = 'https://httpbin.org/get' r = client.get(url=request_url) print(r.text)
Traceback
Traceback (most recent call last):
File "C:/Users/Test/Desktop/Engine/tests/tls-tunneling.py", line 53, in
Environment
- OS: Windows 10
- Python version: Python 3.8.1
- HTTPX version: 0.16.1
- HTTP proxy: Yes
- Custom certificates: No
Im use my HTTP proxy for custom TLS, i have a problems with TUNNEL_ONLY
@Sweety133 Hi,
In my mind there are two possibilities, that basically depend on what we do when using TUNNEL_ONLY with an http:// proxy URL.
- If we connect via HTTP (as we should), then it's possible your proxy is in fact an HTTPS one, and we don't support that for now (see related issue).
- If we connect via HTTPS (I don't think that's the case!), then you might want to try dropping TUNNEL_ONLY so HTTPX uses the default.
It's also possible that HTTPS CONNECT is forced because of http2=True. Does it replicate if you drop it so that HTTPX uses standard HTTP/1.1?
My Tunnel support HTTP 2.0, TLS 1.1/1.2/1.3 My Tunnel its HTTP PROXY SERVER I have same error without HTTP 2.0
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'd like to take a look before we consider if this needs closing.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Let's treat this as stale - we can have another look if it gets bought up by anyone again.