{"record":{"id":"7439580f3ceee059","repo":"Billionmail/BillionMail","slug":"verification-type-must-be-either-http-or-dns","errorCode":null,"errorMessage":"verification type must be either 'http' or 'dns'","messagePattern":"verification type must be either 'http' or 'dns'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/service/acme/cli.go","lineNumber":96,"sourceCode":"\n/**\n * @brief Validate parameters\n * @return error\n */\nfunc (cli *AcmeCLI) Validate() error {\n\t// Check email\n\tif cli.Email == \"\" {\n\t\treturn fmt.Errorf(\"email is required\")\n\t}\n\n\t// Check domains\n\tif len(cli.Domains) == 0 {\n\t\treturn fmt.Errorf(\"at least one domain is required\")\n\t}\n\n\t// Check verification type\n\tif cli.VerifyType != \"http\" && cli.VerifyType != \"dns\" {\n\t\treturn fmt.Errorf(\"verification type must be either 'http' or 'dns'\")\n\t}\n\n\t// Check DNS provider if using DNS verification\n\tif cli.VerifyType == \"dns\" {\n\t\tif cli.DnsProvider == \"\" {\n\t\t\treturn fmt.Errorf(\"DNS provider is required for DNS verification\")\n\t\t}\n\n\t\t// Check if DNS provider is supported\n\t\tsupportedProviders := []string{\"tencentcloud\", \"alidns\", \"cloudxns\", \"azuredns\", \"cloudflare\", \"godaddy\"}\n\t\tisSupported := false\n\t\tfor _, provider := range supportedProviders {\n\t\t\tif cli.DnsProvider == provider {\n\t\t\t\tisSupported = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/service/acme/cli.go#L78-L114","documentation":"AcmeCLI.Validate returns this error when VerifyType is neither \"http\" nor \"dns\". The CLI only supports those two ACME challenge types; anything else (including empty or differently-cased values) is rejected before calling Apply.","triggerScenarios":"Setting cli.VerifyType to \"HTTP\", \"tls-alpn-01\", \"\", or any value other than exactly \"http\"/\"dns\", then calling Validate/Apply.","commonSituations":"Case mismatch (\"HTTP\") when copying from docs; users expecting tls-alpn-01 support; empty VerifyType when the flag is omitted and there is no default.","solutions":["Set VerifyType to exactly \"http\" or \"dns\" (lowercase)","Normalize user input with strings.ToLower(strings.TrimSpace(v)) before assignment","Default to \"http\" when the flag is omitted"],"exampleFix":"// before\ncli.VerifyType = \"DNS\" // case mismatch\n// after\ncli.VerifyType = strings.ToLower(strings.TrimSpace(flagVerify))\nif cli.VerifyType == \"\" { cli.VerifyType = \"http\" }","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"http\": true, \"dns\": true}\nv := strings.ToLower(strings.TrimSpace(flagVerify))\nif !allowed[v] { return fmt.Errorf(\"verify type must be http or dns, got %q\", flagVerify) }","typeGuard":null,"tryCatchPattern":"if err := cli.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"verification type must be\") {\n        log.Printf(\"invalid --verify-type %q: use http or dns\", cli.VerifyType)\n    }\n    os.Exit(1)\n}","preventionTips":["Normalize user input (lowercase/trim) before assigning VerifyType","Constrain the flag with a fixed choices list in flag help","Default to \"http\" when unset","Never assume other ACME challenge types are supported by this CLI"],"tags":["validation","acme","enum-value"],"backgroundTag":"invalid-enum-value","analyzedSha":"fc36c76c050c3775c5e899faf7403cf0262d2744","analyzedAt":"2026-09-05T21:28:54.019Z","contentChangedAt":"2026-09-05T21:28:54.019Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}