aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/caddytls/certselection.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddytls/certselection.go')
-rw-r--r--modules/caddytls/certselection.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/modules/caddytls/certselection.go b/modules/caddytls/certselection.go
index 84ca2e118..a561e3a1d 100644
--- a/modules/caddytls/certselection.go
+++ b/modules/caddytls/certselection.go
@@ -20,6 +20,7 @@ import (
"encoding/json"
"fmt"
"math/big"
+ "slices"
"github.com/caddyserver/certmagic"
@@ -72,15 +73,9 @@ nextChoice:
}
if len(p.SubjectOrganization) > 0 {
- var found bool
- for _, subjOrg := range p.SubjectOrganization {
- for _, org := range cert.Leaf.Subject.Organization {
- if subjOrg == org {
- found = true
- break
- }
- }
- }
+ found := slices.ContainsFunc(p.SubjectOrganization, func(s string) bool {
+ return slices.Contains(cert.Leaf.Subject.Organization, s)
+ })
if !found {
continue
}