mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
refactor
This commit is contained in:
parent
d013d09a9b
commit
c2faab23b6
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue