From 9aa9e8c99a169eec0f435fbf2df1bdeb919417ba Mon Sep 17 00:00:00 2001 From: Mmx233 Date: Thu, 4 Apr 2024 17:32:47 +0800 Subject: [PATCH] improve: use k3s tls secret field name to load ca cert --- internal/global/keypair.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/global/keypair.go b/internal/global/keypair.go index 91a1525..aa22acb 100644 --- a/internal/global/keypair.go +++ b/internal/global/keypair.go @@ -9,10 +9,12 @@ import ( ) const ( - _PublicCrtName = "cert.crt" _PublicKeyName = "public.pem" _PrivateKeyName = "private.pem" + _PublicTlsKeyName = "tls.crt" + _PrivateTlsKeyName = "tls.key" + dirJwt = "jwt" dirCa = "ca" ) @@ -38,11 +40,11 @@ func initCaIssuer() { var loader = ed25519Pkg.Loader{ Dir: path.Join(ConfigDir, dirCa), } - certBytes, err := loader.LoadPem(_PublicCrtName) + certBytes, err := loader.LoadPem(_PublicTlsKeyName) if err != nil { log.Fatalln("read ca cert failed:", err) } - keyBytes, err := loader.LoadPem(_PrivateKeyName) + keyBytes, err := loader.LoadPem(_PrivateTlsKeyName) if err != nil { log.Fatalln("read ca key failed:", err) }