troubleshooting.md
This file
Path
docs/troubleshooting.md
61 lines · 1.9 KiB · Markdown
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 67c2970 point at it.
Drop EOL Python 3.6 (#2097)Ofek Levbefore adoption67c2970
lines 1–22why, one step back1# Troubleshooting23This page lists some common problems or issues you could encounter while developing with HTTPX, as well as possible solutions.45## Proxies67---89### "`The handshake operation timed out`" on HTTPS requests when using a proxy1011**Description**: When using a proxy and making an HTTPS request, you see an exception looking like this:1213```console14httpx.ProxyError: _ssl.c:1091: The handshake operation timed out15```1617**Similar issues**: [encode/httpx#1412](https://github.com/encode/httpx/issues/1412), [encode/httpx#1433](https://github.com/encode/httpx/issues/1433)1819**Resolution**: it is likely that you've set up your proxies like this...2021```python22proxies = {docs: Fix proxy examples (#2183)nyuszika7hbefore adoption782f507
lines 23–24why, one step back23 "http://": "http://myproxy.org",24 "https://": "https://myproxy.org",Drop EOL Python 3.6 (#2097)Ofek Levbefore adoption67c2970
lines 25–35why, one step back25}26```2728Using this setup, you're telling HTTPX to connect to the proxy using HTTP for HTTP requests, and using HTTPS for HTTPS requests.2930But if you get the error above, it is likely that your proxy doesn't support connecting via HTTPS. Don't worry: that's a [common gotcha](advanced.md#example).3132Change the scheme of your HTTPS proxy to `http://...` instead of `https://...`:3334```python35proxies = {docs: Fix proxy examples (#2183)nyuszika7hbefore adoption782f507
lines 36–37why, one step back36 "http://": "http://myproxy.org",37 "https://": "http://myproxy.org",Drop EOL Python 3.6 (#2097)Ofek Levbefore adoption67c2970
lines 38–61why, one step back38}39```4041This can be simplified to:4243```python44proxies = "http://myproxy.org"45```4647For more information, see [Proxies: FORWARD vs TUNNEL](advanced.md#forward-vs-tunnel).4849---5051### Error when making requests to an HTTPS proxy5253**Description**: your proxy _does_ support connecting via HTTPS, but you are seeing errors along the lines of...5455```console56httpx.ProxyError: [SSL: PRE_MAC_LENGTH_TOO_LONG] invalid alert (_ssl.c:1091)57```5859**Similar issues**: [encode/httpx#1424](https://github.com/encode/httpx/issues/1424).6061**Resolution**: HTTPX does not properly support HTTPS proxies at this time. If that's something you're interested in having, please see [encode/httpx#1434](https://github.com/encode/httpx/issues/1434) and consider lending a hand there.