{"record":{"id":"80d85ad33d305bd9","repo":"caddyserver/caddy","slug":"checking-v-to-determine-if-certificate-for-hostna","errorCode":null,"errorMessage":"checking %v to determine if certificate for hostname '%s' should be allowed: %v","messagePattern":"checking (.+?) to determine if certificate for hostname '(.+?)' should be allowed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/caddytls/ondemand.go","lineNumber":150,"sourceCode":"\taskURL.RawQuery = qs.Encode()\n\taskURLString := askURL.String()\n\n\tvar remote string\n\tif chi, ok := ctx.Value(certmagic.ClientHelloInfoCtxKey).(*tls.ClientHelloInfo); ok && chi != nil {\n\t\tremote = chi.Conn.RemoteAddr().String()\n\t}\n\n\tif c := p.logger.Check(zapcore.DebugLevel, \"asking permission endpoint\"); c != nil {\n\t\tc.Write(\n\t\t\tzap.String(\"remote\", remote),\n\t\t\tzap.String(\"domain\", name),\n\t\t\tzap.String(\"url\", askURLString),\n\t\t)\n\t}\n\n\tresp, err := onDemandAskClient.Get(askURLString)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"checking %v to determine if certificate for hostname '%s' should be allowed: %v\",\n\t\t\taskEndpoint, name, err)\n\t}\n\tresp.Body.Close()\n\n\tif c := p.logger.Check(zapcore.DebugLevel, \"response from permission endpoint\"); c != nil {\n\t\tc.Write(\n\t\t\tzap.String(\"remote\", remote),\n\t\t\tzap.String(\"domain\", name),\n\t\t\tzap.String(\"url\", askURLString),\n\t\t\tzap.Int(\"status\", resp.StatusCode),\n\t\t)\n\t}\n\n\tif resp.StatusCode < 200 || resp.StatusCode > 299 {\n\t\treturn fmt.Errorf(\"%s: %w %s - non-2xx status code %d\", name, ErrPermissionDenied, askEndpoint, resp.StatusCode)\n\t}\n\n\treturn nil","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/caddytls/ondemand.go#L132-L168","documentation":"Error \"checking %v to determine if certificate for hostname '%s' should be allowed: %v\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at modules/caddytls/ondemand.go:150 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the 'ask' endpoint is reachable and responding; the wrapped error explains the request failure."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}