{"record":{"id":"5f6724883f5fc103","repo":"JuliusBrussee/caveman","slug":"ssrf-managed-mode-requires-port-443","errorCode":null,"errorMessage":"ssrf: managed mode requires port 443","messagePattern":"ssrf: managed mode requires port 443","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shared/platform/ssrf/ssrf.go","lineNumber":178,"sourceCode":"\tu, err := url.Parse(raw)\n\tif err != nil {\n\t\t// net/url.Error includes the raw URL (and may therefore include\n\t\t// credentials or query secrets). Keep this error field-only and stable.\n\t\treturn errors.New(\"ssrf: invalid URL\")\n\t}\n\tif u.Scheme != \"https\" && !(u.Scheme == \"http\" && !cfg.ManagedMode) {\n\t\treturn fmt.Errorf(\"ssrf: scheme %q not permitted (managed mode requires https)\", u.Scheme)\n\t}\n\tif u.User != nil {\n\t\treturn fmt.Errorf(\"ssrf: credentials embedded in URL are forbidden\")\n\t}\n\thost := u.Hostname()\n\tif host == \"\" {\n\t\treturn fmt.Errorf(\"ssrf: URL must contain a host\")\n\t}\n\tport := u.Port()\n\tif cfg.ManagedMode && port != \"\" && port != \"443\" {\n\t\treturn errors.New(\"ssrf: managed mode requires port 443\")\n\t}\n\tif port == \"\" {\n\t\tif u.Scheme == \"https\" {\n\t\t\tport = \"443\"\n\t\t} else {\n\t\t\tport = \"80\"\n\t\t}\n\t}\n\treturn validateHostPort(ctx, host, port, cfg)\n}\n\n// ValidateHost resolves host (bare hostname or IP literal) and checks all\n// resolved addresses.  Use when you have a host/port pair rather than a full\n// URL.\nfunc ValidateHost(ctx context.Context, host string, cfg Config) error {\n\treturn validateHostPort(ctx, host, \"\", cfg)\n}\n","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/shared/platform/ssrf/ssrf.go#L160-L196","documentation":"Error \"ssrf: managed mode requires port 443\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at shared/platform/ssrf/ssrf.go:178 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use port 443 in managed mode."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}