The Fix
Upgrade to version 0.13.0 or later.
Based on closed encode/httpx issue #847 · PR/commit linked
Production note: This usually shows up under retries/timeouts. Treat it as a side-effect risk until you can verify behavior with a canary + real traffic.
@@ -176,7 +176,7 @@ client = httpx.Client(trust_env=False)
## HTTP Proxying
-HTTPX supports setting up proxies the same way that Requests does via the `proxies` parameter.
+HTTPX supports setting up HTTP proxies the same way that Requests does via the `proxies` parameter.
For example to forward all HTTP traffic to `http://127.0.0.1:3080` and all HTTPS traffic
proxy = httpx.Proxy(
url=f"http://[username]%40[mail-domain]:[password]@{proxy}:80"
)
with httpx.Client(proxies=proxy, trust_env=False) as client:
resp = client.get("https://www.gazzetta.it")
print(resp.text)
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\nUpgrade to version 0.13.0 or later.\nWhen NOT to use: Do not use this fix if the proxy does not require authentication.\n\n
Why This Fix Works in Production
- Trigger: From reading the documentation of httpx it seems to me that the below should work but I am getting error code 407 which means that authentication definitely…
- Mechanism: HTTPX did not create a Proxy-Authorization header for proxy URLs with credentials
- Why the fix works: Detects credentials in proxy URLs and creates a Proxy-Authorization header, addressing issues with proxy authentication. (first fixed release: 0.13.0).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- HTTPX did not create a Proxy-Authorization header for proxy URLs with credentials
- Production symptom (often without a traceback): From reading the documentation of httpx it seems to me that the below should work but I am getting error code 407 which means that authentication definitely did not happen.
Proof / Evidence
- GitHub issue: #847
- Fix PR: https://github.com/encode/httpx/pull/780
- First fixed release: 0.13.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.56
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Closing as a duplicate of https://github.com/encode/httpx/issues/779 for now, feel free to reopen if you come across any issues with the latest version of HTTPX. :)”
“Ah indeed, latest release is from Jan 17 (quite a while back now!), and #780 was merged on Jan 19”
“Cool! Time to sharpen up my pip voodoo. Thanks for the advice”
“Actually it seems similar to this issue: https://github.com/encode/httpx/pull/780 WIll try updating the httpx library.”
Failure Signature (Search String)
- From reading the documentation of httpx it seems to me that the below should work but I am getting error code 407 which means that authentication definitely did not happen.
- Closing as a duplicate of https://github.com/encode/httpx/issues/779 for now, feel free to reopen if you come across any issues with the latest version of HTTPX. :)
Copy-friendly signature
Failure Signature
-----------------
From reading the documentation of httpx it seems to me that the below should work but I am getting error code 407 which means that authentication definitely did not happen.
Closing as a duplicate of https://github.com/encode/httpx/issues/779 for now, feel free to reopen if you come across any issues with the latest version of HTTPX. :)
Error Message
Signature-only (no traceback captured)
Error Message
-------------
From reading the documentation of httpx it seems to me that the below should work but I am getting error code 407 which means that authentication definitely did not happen.
Closing as a duplicate of https://github.com/encode/httpx/issues/779 for now, feel free to reopen if you come across any issues with the latest version of HTTPX. :)
Minimal Reproduction
proxy = httpx.Proxy(
url=f"http://[username]%40[mail-domain]:[password]@{proxy}:80"
)
with httpx.Client(proxies=proxy, trust_env=False) as client:
resp = client.get("https://www.gazzetta.it")
print(resp.text)
What Broke
Users experienced authentication failures when using proxies requiring credentials.
Why It Broke
HTTPX did not create a Proxy-Authorization header for proxy URLs with credentials
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
Upgrade to version 0.13.0 or later.
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/encode/httpx/pull/780
First fixed release: 0.13.0
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not use this fix if the proxy does not require authentication.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
- Upgrade behind a canary and run integration tests against the canary before 100% rollout.
Version Compatibility Table
| Version | Status |
|---|---|
| 0.13.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.