diff --git a/cmd/common-main.go b/cmd/common-main.go index ae2fe9eae..53da483ca 100644 --- a/cmd/common-main.go +++ b/cmd/common-main.go @@ -257,6 +257,9 @@ func initConsoleServer() (*restapi.Server, error) { Path: globalCertsCADir.Get(), } + // set certs before other console initialization + restapi.GlobalRootCAs, restapi.GlobalPublicCerts, restapi.GlobalTLSCertsManager = globalRootCAs, globalPublicCerts, globalTLSCerts + swaggerSpec, err := loads.Embedded(restapi.SwaggerJSON, restapi.FlatSwaggerJSON) if err != nil { return nil, err @@ -283,8 +286,6 @@ func initConsoleServer() (*restapi.Server, error) { // register all APIs server.ConfigureAPI() - restapi.GlobalRootCAs, restapi.GlobalPublicCerts, restapi.GlobalTLSCertsManager = globalRootCAs, globalPublicCerts, globalTLSCerts - consolePort, _ := strconv.Atoi(globalMinioConsolePort) server.Host = globalMinioConsoleHost