fix: console should trust itself with its own public.crt (#827)

This commit is contained in:
Harshavardhana
2021-06-21 18:15:57 -07:00
committed by GitHub
parent b10c4f51b1
commit fd86e65e5e
2 changed files with 4 additions and 5 deletions

View File

@@ -325,5 +325,9 @@ func GetAllCertificatesAndCAs() (*x509.CertPool, []*x509.Certificate, *xcerts.Ma
if rootCAs == nil {
rootCAs = &x509.CertPool{}
}
// Add the public crts as part of root CAs to trust self.
for _, publicCrt := range publicCerts {
rootCAs.AddCert(publicCrt)
}
return rootCAs, publicCerts, certsManager, nil
}

View File

@@ -147,11 +147,6 @@ func configureAPI(api *operations.ConsoleAPI) http.Handler {
// The TLS configuration before HTTPS server starts.
func configureTLS(tlsConfig *tls.Config) {
// Add the global public crts as part of global root CAs
for _, publicCrt := range GlobalPublicCerts {
GlobalRootCAs.AddCert(publicCrt)
}
tlsConfig.RootCAs = GlobalRootCAs
tlsConfig.GetCertificate = GlobalTLSCertsManager.GetCertificate
}