diff options
Diffstat (limited to 'weed/security/tls.go')
| -rw-r--r-- | weed/security/tls.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/security/tls.go b/weed/security/tls.go index 1832e6e07..ff5881605 100644 --- a/weed/security/tls.go +++ b/weed/security/tls.go @@ -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() |
