aboutsummaryrefslogtreecommitdiff
path: root/weed/security/tls.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-09-20 15:40:49 -0700
committerChris Lu <chris.lu@gmail.com>2020-09-20 15:40:49 -0700
commitc2faab23b6cac365c4ebcc13fddefdfb74c03a70 (patch)
treef2bf9ffddd04aae000955292e1c9bad6e205b680 /weed/security/tls.go
parentd013d09a9be3fd6a9eea2da6b01d6991d777ba93 (diff)
downloadseaweedfs-c2faab23b6cac365c4ebcc13fddefdfb74c03a70.tar.xz
seaweedfs-c2faab23b6cac365c4ebcc13fddefdfb74c03a70.zip
refactor
Diffstat (limited to 'weed/security/tls.go')
-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()