aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--weed/security/tls.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/security/tls.go b/weed/security/tls.go
index ff5881605..5821b159d 100644
--- a/weed/security/tls.go
+++ b/weed/security/tls.go
@@ -45,8 +45,8 @@ func LoadClientTLS(config *viper.Viper, component string) grpc.DialOption {
return grpc.WithInsecure()
}
- certFileName, keyFileName := config.GetString(component+".cert"), config.GetString(component+".key")
- if certFileName == "" || keyFileName == "" {
+ certFileName, keyFileName, caFileName := config.GetString(component+".cert"), config.GetString(component+".key"), config.GetString(component+".ca")
+ if certFileName == "" || keyFileName == "" || caFileName == "" {
return grpc.WithInsecure()
}
@@ -56,7 +56,7 @@ func LoadClientTLS(config *viper.Viper, component string) grpc.DialOption {
glog.V(1).Infof("load cert/key error: %v", err)
return grpc.WithInsecure()
}
- caCert, err := ioutil.ReadFile(config.GetString(component + ".ca"))
+ caCert, err := ioutil.ReadFile(caFileName)
if err != nil {
glog.V(1).Infof("read ca cert file error: %v", err)
return grpc.WithInsecure()