{"record":{"id":"9439dcea0dfbf8d0","repo":"caddyserver/caddy","slug":"preparing-ask-endpoint-v","errorCode":null,"errorMessage":"preparing 'ask' endpoint: %v","messagePattern":"preparing 'ask' endpoint: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/caddytls/ondemand.go","lineNumber":123,"sourceCode":"\t\treturn nil\n\t}\n\tif !d.AllArgs(&p.Endpoint) {\n\t\treturn d.ArgErr()\n\t}\n\treturn nil\n}\n\nfunc (p *PermissionByHTTP) Provision(ctx caddy.Context) error {\n\tp.logger = ctx.Logger()\n\tp.replacer = caddy.NewReplacer()\n\treturn nil\n}\n\nfunc (p PermissionByHTTP) CertificateAllowed(ctx context.Context, name string) error {\n\t// run replacer on endpoint URL (for environment variables) -- return errors to prevent surprises (#5036)\n\taskEndpoint, err := p.replacer.ReplaceOrErr(p.Endpoint, true, true)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"preparing 'ask' endpoint: %v\", err)\n\t}\n\n\taskURL, err := url.Parse(askEndpoint)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"parsing ask URL: %v\", err)\n\t}\n\tqs := askURL.Query()\n\tqs.Set(\"domain\", name)\n\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(","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/caddytls/ondemand.go#L105-L141","documentation":"Error \"preparing 'ask' endpoint: %v\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at modules/caddytls/ondemand.go:123 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the on-demand TLS 'ask' endpoint configuration; the wrapped error explains the problem."],"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-15T22:17:37.221Z"}