From e8296104fc715f0f7c41a82059f366603b3e94f0 Mon Sep 17 00:00:00 2001 From: limd Date: Sun, 22 Nov 2020 20:27:15 +0800 Subject: [PATCH] fix tls grpc ca path --- weed/security/tls.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/security/tls.go b/weed/security/tls.go index 5821b159d..72363768f 100644 --- a/weed/security/tls.go +++ b/weed/security/tls.go @@ -24,7 +24,7 @@ func LoadServerTLS(config *viper.Viper, component string) grpc.ServerOption { glog.V(1).Infof("load cert/key error: %v", err) return nil } - caCert, err := ioutil.ReadFile(config.GetString(component + ".ca")) + caCert, err := ioutil.ReadFile(config.GetString("grpc.ca")) if err != nil { glog.V(1).Infof("read ca cert file error: %v", err) return nil @@ -45,7 +45,7 @@ func LoadClientTLS(config *viper.Viper, component string) grpc.DialOption { return grpc.WithInsecure() } - certFileName, keyFileName, caFileName := config.GetString(component+".cert"), config.GetString(component+".key"), config.GetString(component+".ca") + certFileName, keyFileName, caFileName := config.GetString(component+".cert"), config.GetString(component+".key"), config.GetString("grpc.ca") if certFileName == "" || keyFileName == "" || caFileName == "" { return grpc.WithInsecure() }