{
  "id": "go/grpc-permission-denied-tls-mismatch",
  "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 error: code = Unavailable desc = 连接错误：传输：认证握手失败：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": "auth_error",
  "subcategory": null,
  "root_cause": "The client is attempting TLS but the server is serving plaintext (or vice versa). Common when mixing grpc.WithInsecure() with a TLS server or dialing a plaintext port with credentials.",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端尝试使用 TLS，但服务端提供明文（或反之）。常见于将 grpc.WithInsecure() 与 TLS 服务端混用，或使用凭证拨号明文端口时。",
  "versions": [
    {
      "version": "1.40+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Silences TLS but breaks against a TLS-only server; also disables security in production",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Does not help when the server isn't speaking TLS at all; and it weakens security",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.93,
      "how": "// TLS server\ncreds, _ := credentials.NewServerTLSFromFile(\"server.crt\", \"server.key\")\ns := grpc.NewServer(grpc.Creds(creds))\n// TLS client\ncreds, _ := credentials.NewClientTLSFromFile(\"ca.crt\", \"\")\nconn, _ := grpc.Dial(addr, grpc.WithTransportCredentials(creds))",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "import \"google.golang.org/grpc/credentials/insecure\"\nconn, _ := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials()))",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-11-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}