Fix missing default store value

This commit is contained in:
世界 2025-01-30 22:20:36 +08:00
parent 438405bbf1
commit 4f61fc20e0
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
2 changed files with 3 additions and 2 deletions

View File

@ -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 {

View File

@ -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 {