Fix KeyMaterial nil bug (#5849)

This commit is contained in:
qinguoyi 2024-08-03 02:06:48 +08:00 committed by GitHub
parent e88da0be1b
commit bf2366ba3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -240,6 +240,9 @@ func runFiler(cmd *Command, args []string) bool {
// GetCertificateWithUpdate Auto refreshing TSL certificate
func (fo *FilerOptions) GetCertificateWithUpdate(*tls.ClientHelloInfo) (*tls.Certificate, error) {
certs, err := fo.certProvider.KeyMaterial(context.Background())
if certs == nil {
return nil, err
}
return &certs.Certs[0], err
}