{
  "id": "python/aiohttp-cannot-connect-to-host-ssl",
  "signature": "aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host api.example.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')]",
  "signature_zh": "aiohttp.client_exceptions.ClientConnectorCertificateError: 无法连接到主机 api.example.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败：无法获取本地颁发者证书 (_ssl.c:1006)')]",
  "regex": "aiohttp\\.client_exceptions\\.ClientConnectorCertificateError:\\ Cannot\\ connect\\ to\\ host\\ api\\.example\\.com:443\\ ssl:True\\ \\[SSLCertVerificationError:\\ \\(1,\\ '\\[SSL:\\ CERTIFICATE_VERIFY_FAILED\\]\\ certificate\\ verify\\ failed:\\ unable\\ to\\ get\\ local\\ issuer\\ certificate\\ \\(_ssl\\.c:1006\\)'\\)\\]",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The client cannot find the CA bundle to verify the server certificate, often on macOS Python.org builds or in containers missing ca-certificates.",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端找不到用于验证服务器证书的 CA 证书包，常见于 macOS 官方 Python 构建或缺少 ca-certificates 的容器中。",
  "versions": [
    {
      "version": "3.8+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.12+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Disables TLS verification entirely, exposing the app to MITM; often blocked by security policy.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The issue is the system trust store, not the aiohttp package.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "import ssl, certifi, aiohttp\nctx = ssl.create_default_context(cafile=certifi.where())\nconn = aiohttp.TCPConnector(ssl=ctx)\nasync with aiohttp.ClientSession(connector=conn) as s:\n    ...",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "# macOS\n/Applications/Python\\ 3.12/Install\\ Certificates.command",
      "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-02-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}