Set Console global Root CAs early to trust provided certs (#16890)

This commit is contained in:
Anis Eleuch
2023-03-25 17:58:38 +01:00
committed by GitHub
parent 58c129f94a
commit 8b4d0255b7

View File

@@ -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