Skip to content

Commit

Permalink
fix linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
chodges15 committed Jan 30, 2023
1 parent 86a397b commit 6149788
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web/tls_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type TLSConfig struct {
MinVersion TLSVersion `yaml:"min_version"`
MaxVersion TLSVersion `yaml:"max_version"`
PreferServerCipherSuites bool `yaml:"prefer_server_cipher_suites"`
ClientCertAllowedSanDns string `yaml:"client_cert_allowed_san_dns"`
ClientCertAllowedSanDNS string `yaml:"client_cert_allowed_san_dns"`
}

type FlagConfig struct {
Expand All @@ -76,12 +76,12 @@ func (t *TLSConfig) VerifyPeerCertificate(rawCerts [][]byte, verifiedChains [][]
}

for _, san := range cert.DNSNames {
if san == t.ClientCertAllowedSanDns {
if san == t.ClientCertAllowedSanDNS {
return nil
}
}

return fmt.Errorf("could not find configured SAN DNS in client cert: %s", t.ClientCertAllowedSanDns)
return fmt.Errorf("could not find configured SAN DNS in client cert: %s", t.ClientCertAllowedSanDNS)
}

type HTTPConfig struct {
Expand Down Expand Up @@ -181,7 +181,7 @@ func ConfigToTLSConfig(c *TLSConfig) (*tls.Config, error) {
cfg.ClientCAs = clientCAPool
}

if c.ClientCertAllowedSanDns != "" {
if c.ClientCertAllowedSanDNS != "" {
// verify that the client cert contains the allowed domain name
cfg.VerifyPeerCertificate = c.VerifyPeerCertificate
}
Expand Down

0 comments on commit 6149788

Please sign in to comment.