@@ -24,6 +24,7 @@ import (
2424 "net/url"
2525 "os"
2626 "path/filepath"
27+ "slices"
2728 "strconv"
2829 "strings"
2930 "time"
@@ -97,10 +98,8 @@ func (t *TLSConfig) VerifyPeerCertificate(rawCerts [][]byte, _ [][]*x509.Certifi
9798 }
9899
99100 for _ , sanValue := range sanValues {
100- for _ , allowedSan := range t .ClientAllowedSans {
101- if sanValue == allowedSan {
102- return nil
103- }
101+ if slices .Contains (t .ClientAllowedSans , sanValue ) {
102+ return nil
104103 }
105104 }
106105
@@ -440,7 +439,7 @@ func Validate(tlsConfigPath string) error {
440439
441440type Cipher uint16
442441
443- func (c * Cipher ) UnmarshalYAML (unmarshal func (interface {} ) error ) error {
442+ func (c * Cipher ) UnmarshalYAML (unmarshal func (any ) error ) error {
444443 var s string
445444 err := unmarshal (& s )
446445 if err != nil {
@@ -455,7 +454,7 @@ func (c *Cipher) UnmarshalYAML(unmarshal func(interface{}) error) error {
455454 return errors .New ("unknown cipher: " + s )
456455}
457456
458- func (c Cipher ) MarshalYAML () (interface {} , error ) {
457+ func (c Cipher ) MarshalYAML () (any , error ) {
459458 return tls .CipherSuiteName ((uint16 )(c )), nil
460459}
461460
@@ -468,7 +467,7 @@ var curves = map[string]Curve{
468467 "X25519" : (Curve )(tls .X25519 ),
469468}
470469
471- func (c * Curve ) UnmarshalYAML (unmarshal func (interface {} ) error ) error {
470+ func (c * Curve ) UnmarshalYAML (unmarshal func (any ) error ) error {
472471 var s string
473472 err := unmarshal (& s )
474473 if err != nil {
@@ -481,7 +480,7 @@ func (c *Curve) UnmarshalYAML(unmarshal func(interface{}) error) error {
481480 return errors .New ("unknown curve: " + s )
482481}
483482
484- func (c * Curve ) MarshalYAML () (interface {} , error ) {
483+ func (c * Curve ) MarshalYAML () (any , error ) {
485484 for s , curveid := range curves {
486485 if * c == curveid {
487486 return s , nil
@@ -499,7 +498,7 @@ var tlsVersions = map[string]TLSVersion{
499498 "TLS10" : (TLSVersion )(tls .VersionTLS10 ),
500499}
501500
502- func (tv * TLSVersion ) UnmarshalYAML (unmarshal func (interface {} ) error ) error {
501+ func (tv * TLSVersion ) UnmarshalYAML (unmarshal func (any ) error ) error {
503502 var s string
504503 err := unmarshal (& s )
505504 if err != nil {
@@ -512,7 +511,7 @@ func (tv *TLSVersion) UnmarshalYAML(unmarshal func(interface{}) error) error {
512511 return errors .New ("unknown TLS version: " + s )
513512}
514513
515- func (tv * TLSVersion ) MarshalYAML () (interface {} , error ) {
514+ func (tv * TLSVersion ) MarshalYAML () (any , error ) {
516515 for s , v := range tlsVersions {
517516 if * tv == v {
518517 return s , nil
0 commit comments