adjust logging

This commit is contained in:
Chris Lu
2020-09-20 15:38:59 -07:00
parent f498c71199
commit d013d09a9b
7 changed files with 11 additions and 17 deletions

View File

@@ -45,8 +45,13 @@ 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 == "" {
return grpc.WithInsecure()
}
// load cert/key, cacert
cert, err := tls.LoadX509KeyPair(config.GetString(component+".cert"), config.GetString(component+".key"))
cert, err := tls.LoadX509KeyPair(certFileName, keyFileName)
if err != nil {
glog.V(1).Infof("load cert/key error: %v", err)
return grpc.WithInsecure()