{
  "id": "python/requests-connectionerror-proxy-authentication",
  "signature": "requests.exceptions.ConnectionError: HTTPConnectionPool(host='proxy.example.com', port=8080): Max retries exceeded with url: http://target.com/ (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required')))",
  "signature_zh": "requests.exceptions.ConnectionError: HTTPConnectionPool(host='proxy.example.com', port=8080): 超过最大重试次数 (由ProxyError('无法连接到代理。', OSError('隧道连接失败：407 代理身份验证必需'))引起)",
  "regex": "requests\\.exceptions\\.ConnectionError:\\ HTTPConnectionPool\\(host='proxy\\.example\\.com',\\ port=8080\\):\\ Max\\ retries\\ exceeded\\ with\\ url:\\ http://target\\.com/\\ \\(Caused\\ by\\ ProxyError\\('Cannot\\ connect\\ to\\ proxy\\.',\\ OSError\\('Tunnel\\ connection\\ failed:\\ 407\\ Proxy\\ Authentication\\ Required'\\)\\)\\)",
  "domain": "python",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "The proxy requires authentication credentials, but none were provided.",
  "root_cause_type": "generic",
  "root_cause_zh": "代理需要身份验证凭据，但未提供。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Setting the proxy URL without credentials",
      "why_fails": "The proxy server explicitly rejects connections without authentication.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using an environment variable HTTP_PROXY without authentication",
      "why_fails": "Environment variables also need credentials if the proxy requires them.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Include username and password in the proxy URL",
      "success_rate": 0.95,
      "how": "proxies = {'http': 'http://user:password@proxy.example.com:8080'}\nrequests.get('http://target.com', proxies=proxies)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use the requests.auth.HTTPProxyAuth class",
      "success_rate": 0.9,
      "how": "from requests.auth import HTTPProxyAuth\nauth = HTTPProxyAuth('user', 'password')\nrequests.get('http://target.com', proxies={'http': 'http://proxy.example.com:8080'}, auth=auth)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}