{"record":{"id":"6f83115238588a74","repo":"router-for-me/CLIProxyAPI","slug":"home-certificate-request-returned-unsupported-resp","errorCode":null,"errorMessage":"home certificate request returned unsupported resp prefix %q","messagePattern":"home certificate request returned unsupported resp prefix %q","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/home/certificate.go","lineNumber":380,"sourceCode":"\t\tif errSize != nil {\n\t\t\treturn nil, errSize\n\t\t}\n\t\tif size < 0 {\n\t\t\treturn nil, fmt.Errorf(\"home certificate request returned nil\")\n\t\t}\n\t\tpayload := make([]byte, size+2)\n\t\tif _, errFull := io.ReadFull(reader, payload); errFull != nil {\n\t\t\treturn nil, errFull\n\t\t}\n\t\treturn payload[:size], nil\n\tcase '-':\n\t\tline, errLine := reader.ReadString('\\n')\n\t\tif errLine != nil {\n\t\t\treturn nil, errLine\n\t\t}\n\t\treturn nil, fmt.Errorf(\"%s\", strings.TrimSpace(line))\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"home certificate request returned unsupported resp prefix %q\", prefix)\n\t}\n}\n\nfunc fileExists(path string) bool {\n\tinfo, errStat := os.Stat(path)\n\treturn errStat == nil && !info.IsDir()\n}\n","sourceCodeStart":362,"sourceCodeEnd":388,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/home/certificate.go#L362-L388","documentation":"Returned by readRESPBulk in internal/home/certificate.go when the first byte of the reply is neither '$' (bulk string) nor '-' (error). RESP replies of other types — simple status '+OK', integers ':42', arrays '*1', or garbage from a non-RESP service — hit this default branch, and %q shows the offending prefix byte.","triggerScenarios":"The home server replied with a simple status/array/integer where a bulk string was expected, or the connection actually terminated at a non-RESP service (HTTP server, proxy greeting text) so the first byte read is arbitrary ASCII.","commonSituations":"Port points at an HTTP health endpoint or a TLS-terminating proxy that returns plaintext; server version changed its reply type for the CERTIFICATE command; a TCP proxy injected a banner line before RESP data.","solutions":["Check the quoted prefix in the message: letters like 'H' (HTTP) or '-' in unexpected positions indicate the wrong endpoint","Verify host/port target the home RESP listener, not an HTTP/proxy port","Check home server version compatibility for the CERTIFICATE command reply format"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// preflight: verify the port speaks RESP before enrolling\nconn, err := net.DialTimeout(\"tcp\", addr, 2*time.Second)\nif err != nil { return err }\nconn.SetReadDeadline(time.Now().Add(2 * time.Second))\nbuf := make([]byte, 1)\nif _, err := io.ReadFull(conn, buf); err == nil && buf[0] != '$' && buf[0] != '-' && buf[0] != '+' {\n    return fmt.Errorf(\"%s does not speak RESP (first byte %q)\", addr, buf[0])\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin configs to the documented home listener port; keep HTTP and RESP ports separate","Avoid inserting TCP proxies/banners in front of the RESP port"],"tags":["go","resp","protocol","configuration","home"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}