{
  "id": "networking/ssl-unexpected-eof-while-reading",
  "signature": "SSL: error:0A000126:SSL routines::unexpected eof while reading",
  "signature_zh": "SSL：错误：0A000126：SSL例程：读取时遇到意外的EOF",
  "regex": "SSL.*unexpected eof while reading|error:0A000126",
  "domain": "networking",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The remote server closed the TCP connection without completing the TLS handshake or data exchange, often due to a server crash, load balancer timeout, or a protocol mismatch (e.g., HTTP/2 server receiving HTTP/1.1 ClientHello).",
  "root_cause_type": "generic",
  "root_cause_zh": "远程服务器在未完成TLS握手或数据交换的情况下关闭了TCP连接，通常由服务器崩溃、负载均衡器超时或协议不匹配（如HTTP/2服务器收到HTTP/1.1 ClientHello）导致。",
  "versions": [
    {
      "version": "OpenSSL 3.0.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "GnuTLS 3.7.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Nginx 1.24.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This bypasses certificate validation but does not fix the underlying connection issue; the server is still closing the connection prematurely.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The client library is rarely corrupt; the problem is server-side or network-layer (e.g., a proxy terminating the connection).",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "If the server does not support TLS 1.3 or the protocol mismatch is due to ALPN, this will not help and may make things worse.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Retry the request with `curl -v --tlsv1.2 https://example.com` to force a specific TLS version, or use `openssl s_client -connect example.com:443 -debug` to inspect the exact point of failure.",
      "success_rate": 0.85,
      "how": "Retry the request with `curl -v --tlsv1.2 https://example.com` to force a specific TLS version, or use `openssl s_client -connect example.com:443 -debug` to inspect the exact point of failure.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check the server logs for TLS errors (e.g., Nginx error.log for 'SSL_shutdown() failed') and ensure the server is not behind a load balancer that prematurely closes idle connections.",
      "success_rate": 0.8,
      "how": "Check the server logs for TLS errors (e.g., Nginx error.log for 'SSL_shutdown() failed') and ensure the server is not behind a load balancer that prematurely closes idle connections.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add a retry mechanism with exponential backoff in the client code: `for i in 1 2 3; do curl -s https://example.com && break; sleep $((i * 2)); done`",
      "success_rate": 0.75,
      "how": "Add a retry mechanism with exponential backoff in the client code: `for i in 1 2 3; do curl -s https://example.com && break; sleep $((i * 2)); done`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Retry the request with `curl -v --tlsv1.2 https://example.com` to force a specific TLS version, or use `openssl s_client -connect example.com:443 -debug` to inspect the exact point of failure.",
    "Check the server logs for TLS errors (e.g., Nginx error.log for 'SSL_shutdown() failed') and ensure the server is not behind a load balancer that prematurely closes idle connections.",
    "Add a retry mechanism with exponential backoff in the client code: `for i in 1 2 3; do curl -s https://example.com && break; sleep $((i * 2)); done`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.openssl.org/docs/man3.0/man3/SSL_get_error.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.82,
  "resolvable": "partial",
  "first_seen": "2024-05-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}