{"record":{"id":"767204d997132a52","repo":"AlexxIT/go2rtc","slug":"unsupported-auth-auth","errorCode":null,"errorMessage":"unsupported auth: ${auth}","messagePattern":"unsupported auth: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/tcp/request.go","lineNumber":91,"sourceCode":"\n\tuser := req.URL.User\n\n\t// Hikvision won't answer on Basic auth with any headers\n\tif strings.HasPrefix(req.URL.Path, \"/ISAPI/\") {\n\t\treq.URL.User = nil\n\t}\n\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif res.StatusCode == http.StatusUnauthorized && user != nil {\n\t\tClose(res)\n\n\t\tauth := res.Header.Get(\"WWW-Authenticate\")\n\t\tif !strings.HasPrefix(auth, \"Digest\") {\n\t\t\treturn nil, errors.New(\"unsupported auth: \" + auth)\n\t\t}\n\n\t\trealm := Between(auth, `realm=\"`, `\"`)\n\t\tnonce := Between(auth, `nonce=\"`, `\"`)\n\t\tqop := Between(auth, `qop=\"`, `\"`)\n\n\t\tusername := user.Username()\n\t\tpassword, _ := user.Password()\n\t\tha1 := HexMD5(username, realm, password)\n\n\t\turi := req.URL.RequestURI()\n\t\tha2 := HexMD5(req.Method, uri)\n\n\t\tvar header string\n\n\t\tswitch qop {\n\t\tcase \"\":\n\t\t\tresponse := HexMD5(ha1, nonce, ha2)","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/tcp/request.go#L73-L109","documentation":"tcp.Do auth-negotiation guard: the server replied 401 with credentials present, but the WWW-Authenticate header does not start with 'Digest' (raw header appended). Only Digest auth is implemented (Basic is deliberately unsupported here, except the Hikvision ISAPI workaround), so authentication cannot proceed.","triggerScenarios":"Thrown at pkg/tcp/request.go:91 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enable Digest authentication on the camera instead of Basic","Remove credentials to try anonymous access if the device allows it","Proxy the device through something that terminates Basic auth"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}