From 2e1c5091c3fbdba8379d2b2a431023ed204ced48 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Wed, 29 Mar 2023 20:12:12 +0800 Subject: [PATCH] chore: do not load cert pool if not necessary --- component/tls/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/component/tls/config.go b/component/tls/config.go index 06dd88f7..b5b56591 100644 --- a/component/tls/config.go +++ b/component/tls/config.go @@ -40,6 +40,9 @@ func ResetCertificate() { } func getCertPool() *x509.CertPool { + if len(trustCerts) == 0 { + return nil + } if certPool == nil { mutex.Lock() defer mutex.Unlock()