Skip to content

Commit

Permalink
Init expected cert data only once
Browse files Browse the repository at this point in the history
  • Loading branch information
radekg committed Sep 18, 2020
1 parent 7ce2980 commit 3c385ba
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions proxy/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,10 @@ func newTLSListenerConfig(conf *config.Config) (*tls.Config, error) {
}

func tlsClientCertVerificationFunc(conf *config.Config) func([][]byte, [][]*x509.Certificate) error {
expectedData := getClientCertExpectedData(conf)
return func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error {
if conf.Proxy.TLS.ClientCert.ValidateSubject {

expectedData := getClientCertExpectedData(conf)

if len(expectedData.fields) == 0 {
return nil // nothing to validate
}
Expand Down

0 comments on commit 3c385ba

Please sign in to comment.