From 8b4d0255b7247b1a06d923e69ed5ba01434e70b8 Mon Sep 17 00:00:00 2001 From: Anis Eleuch Date: Sat, 25 Mar 2023 17:58:38 +0100 Subject: [PATCH] Set Console global Root CAs early to trust provided certs (#16890) --- cmd/common-main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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