{"record":{"id":"e71020eedb1a3505","repo":"goharbor/harbor","slug":"certificate-must-be-configured-if-serve-with-proto","errorCode":null,"errorMessage":"certificate must be configured if serve with protocol %s","messagePattern":"certificate must be configured if serve with protocol (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/jobservice/config/config.go","lineNumber":321,"sourceCode":"}\n\n// Check if the configurations are valid settings.\nfunc (c *Configuration) validate() error {\n\tif c.Protocol != JobServiceProtocolHTTPS &&\n\t\tc.Protocol != JobServiceProtocolHTTP {\n\t\treturn fmt.Errorf(\"protocol should be %s or %s, but current setting is %s\",\n\t\t\tJobServiceProtocolHTTP,\n\t\t\tJobServiceProtocolHTTPS,\n\t\t\tc.Protocol)\n\t}\n\n\tif !utils.IsValidPort(c.Port) {\n\t\treturn fmt.Errorf(\"port number should be a none zero integer and less or equal 65535, but current is %d\", c.Port)\n\t}\n\n\tif c.Protocol == JobServiceProtocolHTTPS {\n\t\tif c.HTTPSConfig == nil {\n\t\t\treturn fmt.Errorf(\"certificate must be configured if serve with protocol %s\", c.Protocol)\n\t\t}\n\n\t\tif utils.IsEmptyStr(c.HTTPSConfig.Cert) ||\n\t\t\t!utils.FileExists(c.HTTPSConfig.Cert) ||\n\t\t\tutils.IsEmptyStr(c.HTTPSConfig.Key) ||\n\t\t\t!utils.FileExists(c.HTTPSConfig.Key) {\n\t\t\treturn fmt.Errorf(\"certificate for protocol %s is not correctly configured\", c.Protocol)\n\t\t}\n\t}\n\n\tif c.PoolConfig == nil {\n\t\treturn errors.New(\"no worker worker is configured\")\n\t}\n\n\tif c.PoolConfig.Backend != JobServicePoolBackendRedis {\n\t\treturn fmt.Errorf(\"worker worker backend %s does not support\", c.PoolConfig.Backend)\n\t}\n","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/jobservice/config/config.go#L303-L339","documentation":"Error \"certificate must be configured if serve with protocol %s\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/jobservice/config/config.go:321 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":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}