1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-07-03 23:56:41 +02:00

fix tls grpc ca path

This commit is contained in:
limd 2020-11-22 20:27:15 +08:00
parent 4737df597d
commit e8296104fc

View file

@ -24,7 +24,7 @@ func LoadServerTLS(config *viper.Viper, component string) grpc.ServerOption {
glog.V(1).Infof("load cert/key error: %v", err) glog.V(1).Infof("load cert/key error: %v", err)
return nil return nil
} }
caCert, err := ioutil.ReadFile(config.GetString(component + ".ca")) caCert, err := ioutil.ReadFile(config.GetString("grpc.ca"))
if err != nil { if err != nil {
glog.V(1).Infof("read ca cert file error: %v", err) glog.V(1).Infof("read ca cert file error: %v", err)
return nil return nil
@ -45,7 +45,7 @@ func LoadClientTLS(config *viper.Viper, component string) grpc.DialOption {
return grpc.WithInsecure() 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 == "" { if certFileName == "" || keyFileName == "" || caFileName == "" {
return grpc.WithInsecure() return grpc.WithInsecure()
} }