{
  "id": "go/grpc-unavailable-connection-timeout",
  "signature": "rpc error: code = Unavailable desc = connection error: desc = \"transport: authentication handshake failed: tls: first record does not look like a TLS handshake\"",
  "signature_zh": "rpc错误：代码=不可用 描述=连接错误：描述=\"传输：身份验证握手失败：tls：第一条记录看起来不像TLS握手\"",
  "regex": "rpc\\ error:\\ code\\ =\\ Unavailable\\ desc\\ =\\ connection\\ error:\\ desc\\ =\\ \"transport:\\ authentication\\ handshake\\ failed:\\ tls:\\ first\\ record\\ does\\ not\\ look\\ like\\ a\\ TLS\\ handshake\"",
  "domain": "go",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The client is using TLS but the server expects plaintext, or vice versa, causing a handshake failure.",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端使用TLS但服务器期望明文，反之亦然，导致握手失败。",
  "versions": [
    {
      "version": "1.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Ignore TLS configuration and assume automatic negotiation.",
      "why_fails": "gRPC does not auto-negotiate TLS; explicit configuration is required.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a self-signed certificate without proper validation.",
      "why_fails": "The server may reject self-signed certs if it requires a trusted CA.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Match TLS settings between client and server: either both use TLS or both use plaintext.",
      "success_rate": 0.95,
      "how": "// Server with TLS\ncreds, err := credentials.NewServerTLSFromFile(\"server.crt\", \"server.key\")\nif err != nil { log.Fatal(err) }\ns := grpc.NewServer(grpc.Creds(creds))\n// Client with TLS\ncreds, err := credentials.NewClientTLSFromFile(\"ca.crt\", \"x\")\nif err != nil { log.Fatal(err) }\nconn, err := grpc.Dial(\"localhost:8080\", grpc.WithTransportCredentials(creds))",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use insecure connection for development (not recommended for production).",
      "success_rate": 0.9,
      "how": "conn, err := grpc.Dial(\"localhost:8080\", grpc.WithInsecure())",
      "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-07-22",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}