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.

Fix KeyMaterial nil bug (#5848)

qinguoyie88da0be1b6a
diff --git a/weed/command/s3.go b/weed/command/s3.go
index f4c7166c3a..e568de91bb 100644
--- a/weed/command/s3.go
+++ b/weed/command/s3.go
@@ -180,8 +180,11 @@ func runS3(cmd *Command, args []string) bool {
}
// GetCertificateWithUpdate Auto refreshing TSL certificate
-func (S3opt *S3Options) GetCertificateWithUpdate(*tls.ClientHelloInfo) (*tls.Certificate, error) {
- certs, err := S3opt.certProvider.KeyMaterial(context.Background())
+func (s3opt *S3Options) GetCertificateWithUpdate(*tls.ClientHelloInfo) (*tls.Certificate, error) {
+ certs, err := s3opt.certProvider.KeyMaterial(context.Background())
+ if certs == nil {
+ return nil, err
+ }
return &certs.Certs[0], err
}