{
  "id": "python/aiohttp-connector-ssl-certificate-error",
  "signature": "aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host example.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)')]",
  "signature_zh": "aiohttp.client_exceptions.ClientConnectorCertificateError: 无法连接到主机 example.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败：无法获取本地颁发者证书 (_ssl.c:1007)')]",
  "regex": "aiohttp\\.client_exceptions\\.ClientConnectorCertificateError:\\ Cannot\\ connect\\ to\\ host\\ example\\.com:443\\ ssl:True\\ \\[SSLCertVerificationError:\\ \\(1,\\ '\\[SSL:\\ CERTIFICATE_VERIFY_FAILED\\]\\ certificate\\ verify\\ failed:\\ unable\\ to\\ get\\ local\\ issuer\\ certificate\\ \\(_ssl\\.c:1007\\)'\\)\\]",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The TLS certificate chain presented by the server cannot be verified against the CA bundle available to Python, often due to a missing intermediate certificate or an outdated certifi package.",
  "root_cause_type": "generic",
  "root_cause_zh": "服务器提供的 TLS 证书链无法用 Python 可用的 CA 包验证，通常是由于缺少中间证书或 certifi 包过时。",
  "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 security entirely and is rejected in production; also masks the real missing-CA problem.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Certificate verification is deterministic; retries hit the same SSLCertVerificationError.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.88,
      "how": "pip install --upgrade certifi\nimport 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    await s.get(url)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "ctx = ssl.create_default_context(cafile='/etc/ssl/certs/ca-certificates.crt')\nconn = aiohttp.TCPConnector(ssl=ctx)\n# use conn in ClientSession",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-08",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}