Skip to content

Commit

Permalink
removing max version from tls helper
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-bansal committed Nov 2, 2020
1 parent 889630b commit d9ecc72
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions x/tls_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ type TLSHelperConfig struct {
ClientAuth string
UseSystemCACerts bool
MinVersion string
MaxVersion string
}

// RegisterClientTLSFlags registers the required flags to set up a TLS client.
Expand All @@ -70,7 +69,6 @@ func LoadServerTLSConfig(v *viper.Viper, tlsCertFile string, tlsKeyFile string)
conf.Key = path.Join(conf.CertDir, tlsKeyFile)
conf.ClientAuth = v.GetString("tls_client_auth")
conf.MinVersion = v.GetString("tls_min_version")
conf.MaxVersion = v.GetString("tls_max_version")
}
conf.UseSystemCACerts = v.GetBool("tls_use_system_ca")

Expand Down Expand Up @@ -186,7 +184,7 @@ func GenerateServerTLSConfig(config *TLSHelperConfig) (tlsCfg *tls.Config, err e
}
tlsCfg.ClientAuth = auth

err = setupVersion(tlsCfg, config.MinVersion, config.MaxVersion)
err = setupVersion(tlsCfg, config.MinVersion)
if err != nil {
return nil, err
}
Expand All @@ -195,7 +193,7 @@ func GenerateServerTLSConfig(config *TLSHelperConfig) (tlsCfg *tls.Config, err e
return nil, nil
}

func setupVersion(cfg *tls.Config, minVersion string, maxVersion string) error {
func setupVersion(cfg *tls.Config, minVersion string) error {
tlsVersion := map[string]uint16{
"TLS11": tls.VersionTLS11,
"TLS12": tls.VersionTLS12,
Expand Down

0 comments on commit d9ecc72

Please sign in to comment.