Skip to content

Commit

Permalink
Fix tls maxmin version config
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaokangwang committed Mar 16, 2024
1 parent 5c19d6e commit 99f9030
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions transport/internet/tls/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,24 +251,24 @@ func (c *Config) GetTLSConfig(opts ...Option) *tls.Config {
}

switch c.MinVersion {
case tls.VersionTLS10:
case Config_TLS1_0:
config.MinVersion = tls.VersionTLS10
case tls.VersionTLS11:
case Config_TLS1_1:
config.MinVersion = tls.VersionTLS11
case tls.VersionTLS12:
case Config_TLS1_2:
config.MinVersion = tls.VersionTLS12
case tls.VersionTLS13:
case Config_TLS1_3:
config.MinVersion = tls.VersionTLS13
}

switch c.MaxVersion {
case tls.VersionTLS10:
case Config_TLS1_0:
config.MaxVersion = tls.VersionTLS10
case tls.VersionTLS11:
case Config_TLS1_1:
config.MaxVersion = tls.VersionTLS11
case tls.VersionTLS12:
case Config_TLS1_2:
config.MaxVersion = tls.VersionTLS12
case tls.VersionTLS13:
case Config_TLS1_3:
config.MaxVersion = tls.VersionTLS13
}
return config
Expand Down

0 comments on commit 99f9030

Please sign in to comment.