{"record":{"id":"d22e0df5adde55e2","repo":"caddyserver/caddy","slug":"s-try-specifying-https-in-the-address","errorCode":null,"errorMessage":"%s (try specifying https:// in the address)","messagePattern":"(.+?) \\(try specifying https:// in the address\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"caddyconfig/httpcaddyfile/httptype.go","lineNumber":1154,"sourceCode":"}\n\nfunc detectConflictingSchemes(srv *caddyhttp.Server, serverBlocks []serverBlock, options map[string]any) error {\n\thttpPort := strconv.Itoa(caddyhttp.DefaultHTTPPort)\n\tif hp, ok := options[\"http_port\"].(int); ok {\n\t\thttpPort = strconv.Itoa(hp)\n\t}\n\thttpsPort := strconv.Itoa(caddyhttp.DefaultHTTPSPort)\n\tif hsp, ok := options[\"https_port\"].(int); ok {\n\t\thttpsPort = strconv.Itoa(hsp)\n\t}\n\n\tvar httpOrHTTPS string\n\tcheckAndSetHTTP := func(addr Address) error {\n\t\tif httpOrHTTPS == \"HTTPS\" {\n\t\t\terrMsg := fmt.Errorf(\"server listening on %v is configured for HTTPS and cannot natively multiplex HTTP and HTTPS: %s\",\n\t\t\t\tsrv.Listen, addr.Original)\n\t\t\tif addr.Scheme == \"\" && addr.Host == \"\" {\n\t\t\t\terrMsg = fmt.Errorf(\"%s (try specifying https:// in the address)\", errMsg)\n\t\t\t}\n\t\t\treturn errMsg\n\t\t}\n\t\tif len(srv.TLSConnPolicies) > 0 {\n\t\t\t// any connection policies created for an HTTP server\n\t\t\t// is a logical conflict, as it would enable HTTPS\n\t\t\treturn fmt.Errorf(\"server listening on %v is HTTP, but attempts to configure TLS connection policies\", srv.Listen)\n\t\t}\n\t\thttpOrHTTPS = \"HTTP\"\n\t\treturn nil\n\t}\n\tcheckAndSetHTTPS := func(addr Address) error {\n\t\tif httpOrHTTPS == \"HTTP\" {\n\t\t\treturn fmt.Errorf(\"server listening on %v is configured for HTTP and cannot natively multiplex HTTP and HTTPS: %s\",\n\t\t\t\tsrv.Listen, addr.Original)\n\t\t}\n\t\thttpOrHTTPS = \"HTTPS\"\n\t\treturn nil","sourceCodeStart":1136,"sourceCodeEnd":1172,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/caddyconfig/httpcaddyfile/httptype.go#L1136-L1172","documentation":"An appended hint to error 122: when the offending mixed-protocol address has neither scheme nor host (e.g. a bare `:443` address), the adapter suggests specifying `https://` explicitly so the address is unambiguously HTTPS rather than relying on port-based inference.","triggerScenarios":"A site block key like `:443` (empty scheme and host) used together with HTTP addresses on the same server, so the adapter cannot tell the bare address was meant to be HTTPS and the multiplex conflict message gains the '(try specifying https:// in the address)' suffix.","commonSituations":"Catch-all site keys such as `:443` mixed with `http://` sites, or wildcard listener blocks written without a scheme that collide with explicit http sites on the same port.","solutions":["Rewrite the bare address as `https://:443`","Split the catch-all HTTP and HTTPS sites onto separate ports or servers","Drop the bare-address site block if it is redundant"],"exampleFix":"# before\n:443 {\n  respond \"catch-all\"\n}\nhttp://example.com:443 {\n  respond \"http site\"\n}\n# after\nhttps://:443 {\n  respond \"catch-all\"\n}\nhttp://example.com:80 {\n  respond \"http site\"\n}","handlingStrategy":"validation","validationCode":"# Reject bare-address keys mixed with http sites\nassert not any(key == \":443\" for key in block.keys) or no_http_sites_on_443","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write an explicit scheme on catch-all addresses (https://:443)","Keep catch-all blocks on their own listener","Adapt-test configs containing bare addresses"],"tags":["caddy","caddyfile","https","address"],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}