Browse Source

Merge pull request #1643 from hilimd/master

fix tls grpc ca path
pull/1650/head
Chris Lu 4 years ago
committed by GitHub
parent
commit
005a6123e9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      weed/security/tls.go

4
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()
}

Loading…
Cancel
Save