{
  "id": "python/aiohttp-connector-ssl-error",
  "signature": "aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host example.com:443 ssl:True [SSLCertVerificationError: certificate verify failed: unable to get local issuer certificate]",
  "signature_zh": "aiohttp.client_exceptions.ClientConnectorCertificateError: 无法连接到主机 example.com:443 ssl:True [SSLCertVerificationError: 证书验证失败: 无法获取本地颁发者证书]",
  "regex": "aiohttp\\.client_exceptions\\.ClientConnectorCertificateError:\\ Cannot\\ connect\\ to\\ host\\ example\\.com:443\\ ssl:True\\ \\[SSLCertVerificationError:\\ certificate\\ verify\\ failed:\\ unable\\ to\\ get\\ local\\ issuer\\ certificate\\]",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "aiohttp uses the system CA bundle via Python's ssl module; on some platforms (macOS python.org builds, minimal Docker images) the CA store is missing or outdated.",
  "root_cause_type": "generic",
  "root_cause_zh": "aiohttp 通过 Python 的 ssl 模块使用系统 CA 证书；在某些平台（macOS 官方 python.org 构建、精简版 Docker 镜像）上，CA 存储缺失或过期。",
  "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; not acceptable in production.",
      "fail_rate": 0.2,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Only affects urllib/http.client, not aiohttp's SSL context.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The library is not the problem; the CA bundle is.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.92,
      "how": "Install certifi and pass its CA bundle:\n\nimport ssl, certifi\nctx = ssl.create_default_context(cafile=certifi.where())\nasync with aiohttp.ClientSession() as s:\n    await s.get(url, ssl=ctx)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "On macOS, run the 'Install Certificates.command' shipped with python.org installers.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "In Docker, apt-get install -y ca-certificates and run update-ca-certificates in the image build.",
      "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-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}