aboutsummaryrefslogtreecommitdiff
path: root/weed/command/s3.go
diff options
context:
space:
mode:
authorqinguoyi <1532979219@qq.com>2024-08-03 00:47:11 +0800
committerGitHub <noreply@github.com>2024-08-02 09:47:11 -0700
commite88da0be1b6ae1cc78743128f70c7e07cd49ebdd (patch)
tree79d8db0e29dcc427f78a0792a6701601f2e6a9cb /weed/command/s3.go
parent606d0cba64f32de9d4d69470a3f7de29de4e0e2d (diff)
downloadseaweedfs-e88da0be1b6ae1cc78743128f70c7e07cd49ebdd.tar.xz
seaweedfs-e88da0be1b6ae1cc78743128f70c7e07cd49ebdd.zip
Fix KeyMaterial nil bug (#5848)
Diffstat (limited to 'weed/command/s3.go')
-rw-r--r--weed/command/s3.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/weed/command/s3.go b/weed/command/s3.go
index f4c7166c3..e568de91b 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
}