Originally opened by @ElliottMoos on 2020-12-08 22:04:30 in encode/httpx
Checklist
Describe the bug
I get a ProxyError when setting TUNNEL_ONLY to true in httpx.Proxy() for an https proxy url.
To reproduce
import httpx
proxy = httpx.Proxy(
f"https://{PROXY_USER}:{PROXY_PASS}@{PROXY_HOST}:{PROXY_HTTPS_PORT}",
mode="TUNNEL_ONLY",
)
proxies = {
"http://": proxy,
"https://": proxy,
}
def main():
with httpx.Client(proxies=proxies) as client:
response = client.get('https://ifconfig.me/ip')
print('httpx', response.text)
Expected behavior
Actual behavior
received exception of type <class 'httpx.ProxyError'>, url=https://ifconfig.me/ip,
msg=[SSL: PRE_MAC_LENGTH_TOO_LONG] invalid alert (_ssl.c:1091)
Environment
- OS: macOS
- Python version: 3.7.7
- HTTPX version: 0.16.1
- Async environment: No
- HTTP proxy: Yes
- Custom certificates: No
Additional context
Issue #897 is a similar issue but it is considered resolved.
Checklist
master.Describe the bug
I get a ProxyError when setting
TUNNEL_ONLYto true inhttpx.Proxy()for an https proxy url.To reproduce
Expected behavior
Actual behavior
Environment
Additional context
Issue #897 is a similar issue but it is considered resolved.