From 02edb357f80c509a5b51cb2565e6c7da7dda96d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 30 Jan 2025 22:20:36 +0800 Subject: [PATCH] Fix missing default store value --- common/certificate/store.go | 2 +- option/certificate.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/certificate/store.go b/common/certificate/store.go index 18999f23..e42de5f9 100644 --- a/common/certificate/store.go +++ b/common/certificate/store.go @@ -32,7 +32,7 @@ type Store struct { func NewStore(ctx context.Context, logger logger.Logger, options option.CertificateOptions) (*Store, error) { var systemPool *x509.CertPool switch options.Store { - case C.CertificateStoreSystem: + case C.CertificateStoreSystem, "": platformInterface := service.FromContext[platform.Interface](ctx) systemCertificates := platformInterface.SystemCertificates() if len(systemCertificates) > 0 { diff --git a/option/certificate.go b/option/certificate.go index 07b20a2f..ab524b99 100644 --- a/option/certificate.go +++ b/option/certificate.go @@ -24,7 +24,8 @@ func (o CertificateOptions) MarshalJSON() ([]byte, error) { } func (o *CertificateOptions) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, (*_CertificateOptions)(o)); err != nil { + err := json.Unmarshal(data, (*_CertificateOptions)(o)) + if err != nil { return err } switch o.Store {