{"record":{"id":"0ee45102e7bb835c","repo":"JuliusBrussee/caveman","slug":"objectstore-production-requires-tls","errorCode":null,"errorMessage":"objectstore: production requires TLS","messagePattern":"objectstore: production requires TLS","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shared/platform/objectstore/objectstore.go","lineNumber":199,"sourceCode":"\t\tif err := Probe(ctx, store); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"objectstore: production read/write/delete probe failed: %w\", err)\n\t\t}\n\t}\n\treturn store, nil\n}\n\nfunc validateConfig(cfg Config, production bool) error {\n\tif strings.TrimSpace(cfg.Endpoint) == \"\" || strings.TrimSpace(cfg.Bucket) == \"\" {\n\t\treturn errors.New(\"objectstore: endpoint and bucket are required\")\n\t}\n\tif strings.TrimSpace(cfg.AccessKey) == \"\" || strings.TrimSpace(cfg.SecretKey) == \"\" {\n\t\treturn errors.New(\"objectstore: access key and secret key are required\")\n\t}\n\tif !production {\n\t\treturn nil\n\t}\n\tif !cfg.UseSSL || strings.HasPrefix(strings.ToLower(strings.TrimSpace(cfg.Endpoint)), \"http://\") {\n\t\treturn errors.New(\"objectstore: production requires TLS\")\n\t}\n\traw := strings.TrimSpace(cfg.Endpoint)\n\tif !strings.Contains(raw, \"://\") {\n\t\traw = \"https://\" + raw\n\t}\n\tu, err := url.Parse(raw)\n\tif err != nil || u.Scheme != \"https\" || u.Hostname() == \"\" || u.User != nil || u.RawQuery != \"\" || u.Fragment != \"\" || (u.Path != \"\" && u.Path != \"/\") {\n\t\treturn errors.New(\"objectstore: production endpoint must be an HTTPS origin without credentials, path, query, or fragment\")\n\t}\n\treturn nil\n}\n\n// New constructs a MinIO/S3-backed Store. FromEnv adds a live production probe.\nfunc New(cfg Config) (Store, error) {\n\tendpoint := strings.TrimPrefix(strings.TrimPrefix(cfg.Endpoint, \"https://\"), \"http://\")\n\tclient, err := minio.New(endpoint, &minio.Options{\n\t\tCreds:  credentials.NewStaticV4(cfg.AccessKey, cfg.SecretKey, \"\"),\n\t\tSecure: cfg.UseSSL,","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/shared/platform/objectstore/objectstore.go#L181-L217","documentation":"Error \"objectstore: production requires TLS\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at shared/platform/objectstore/objectstore.go:199 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use TLS for the objectstore endpoint in production."],"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"}