{
  "id": "nginx/ssl-certificate-verify-failed-upstream",
  "signature": "SSL certificate verify failed while SSL handshaking to upstream",
  "signature_zh": "与上游SSL握手时证书验证失败",
  "regex": "SSL certificate verify failed while SSL handshaking to upstream",
  "domain": "nginx",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "nginx cannot verify the SSL certificate presented by the upstream server, often due to self-signed certificate, expired certificate, or missing CA bundle.",
  "root_cause_type": "generic",
  "root_cause_zh": "nginx无法验证上游服务器提供的SSL证书，通常由自签名证书、证书过期或缺少CA包引起。",
  "versions": [
    {
      "version": "nginx 1.18.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx 1.20.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx 1.22.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Disable SSL verification entirely (proxy_ssl_verify off)",
      "why_fails": "This removes security without fixing the certificate issue; upstream may still reject connections.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Restart nginx service",
      "why_fails": "Restarting does not update certificate stores or fix certificate chain issues.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase proxy_ssl_handshake_timeout",
      "why_fails": "Timeout does not address certificate validation failure.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add the upstream's CA certificate to nginx's trusted store:\nproxy_ssl_trusted_certificate /etc/nginx/ssl/upstream-ca.crt;\nproxy_ssl_verify on;\nproxy_ssl_verify_depth 2;",
      "success_rate": 0.85,
      "how": "Add the upstream's CA certificate to nginx's trusted store:\nproxy_ssl_trusted_certificate /etc/nginx/ssl/upstream-ca.crt;\nproxy_ssl_verify on;\nproxy_ssl_verify_depth 2;",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using a self-signed certificate, add it to the trusted store or temporarily disable verification for testing:\nproxy_ssl_verify off;  # Only for testing, not production",
      "success_rate": 0.75,
      "how": "If using a self-signed certificate, add it to the trusted store or temporarily disable verification for testing:\nproxy_ssl_verify off;  # Only for testing, not production",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "将上游的CA证书添加到nginx的信任存储：\nproxy_ssl_trusted_certificate /etc/nginx/ssl/upstream-ca.crt;\nproxy_ssl_verify on;\nproxy_ssl_verify_depth 2;",
    "如果使用自签名证书，将其添加到信任存储或临时禁用验证进行测试：\nproxy_ssl_verify off;  # 仅用于测试，不用于生产环境"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ssl_trusted_certificate",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}