{"record":{"id":"77be0ac4814992f9","repo":"googleapis/mcp-toolbox","slug":"failed-to-create-secure-http-client-w","errorCode":null,"errorMessage":"failed to create secure HTTP client: %w","messagePattern":"failed to create secure HTTP client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/http/http.go","lineNumber":145,"sourceCode":"\t\treturn nil, fmt.Errorf(\"invalid customBlockedIpRanges: %w\", err)\n\t}\n\n\tguard := &SSRFGuard{\n\t\tAllowPrivateNetworks: r.AllowPrivateNetworks,\n\t\tAllowedRanges:        allowedRanges,\n\t\tCustomBlocked:        customBlocked,\n\t}\n\n\t// Quick fast-fail check for direct IP configurations in the YAML\n\tif ip := net.ParseIP(parsedURL.Hostname()); ip != nil {\n\t\tif guard.IsIPBlocked(ip) {\n\t\t\treturn nil, fmt.Errorf(\"invalid BaseURL %s: points to a blocked internal IP address\", r.BaseURL)\n\t\t}\n\t}\n\n\tclient, err := createHTTPClient(duration, tr, guard, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create secure HTTP client: %w\", err)\n\t}\n\n\tua, err := util.UserAgentFromContext(ctx)\n\tif err != nil {\n\t\twarnMsg := fmt.Sprintf(\"Error in User Agent retrieval: %s\", err)\n\t\tlogger.WarnContext(ctx, warnMsg)\n\t}\n\tif r.DefaultHeaders == nil {\n\t\tr.DefaultHeaders = make(map[string]string)\n\t}\n\tif existingUA, ok := r.DefaultHeaders[\"User-Agent\"]; ok {\n\t\tua = ua + \" \" + existingUA\n\t}\n\tr.DefaultHeaders[\"User-Agent\"] = ua\n\n\ts := &Source{\n\t\tConfig: r,\n\t\tclient: client,","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/http/http.go#L127-L163","documentation":"Error \"failed to create secure HTTP client: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/http/http.go:145 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}