Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

refactor

Chris Luc2faab23b6ca
diff --git a/weed/security/tls.go b/weed/security/tls.go
index ff58816051..5821b159d4 100644
--- a/weed/security/tls.go
+++ b/weed/security/tls.go
@@ -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()