rename MinVersion to TLSMinVersion
This commit is contained in:
parent
06672d5ff9
commit
614ed283c0
|
@ -119,7 +119,7 @@ Address = "127.0.0.1:6379"
|
||||||
# Password = ""
|
# Password = ""
|
||||||
# DB = 0
|
# DB = 0
|
||||||
# UseTLS = false
|
# UseTLS = false
|
||||||
# MinVersion = "1.2"
|
# TLSMinVersion = "1.2"
|
||||||
|
|
||||||
[Gorm]
|
[Gorm]
|
||||||
# enable debug mode or not
|
# enable debug mode or not
|
||||||
|
|
|
@ -142,7 +142,7 @@ Address = "127.0.0.1:6379"
|
||||||
# Password = ""
|
# Password = ""
|
||||||
# DB = 0
|
# DB = 0
|
||||||
# UseTLS = false
|
# UseTLS = false
|
||||||
# MinVersion = "1.2"
|
# TLSMinVersion = "1.2"
|
||||||
|
|
||||||
[Gorm]
|
[Gorm]
|
||||||
# enable debug mode or not
|
# enable debug mode or not
|
||||||
|
|
|
@ -18,7 +18,7 @@ type ClientConfig struct {
|
||||||
TLSKeyPwd string
|
TLSKeyPwd string
|
||||||
InsecureSkipVerify bool
|
InsecureSkipVerify bool
|
||||||
ServerName string
|
ServerName string
|
||||||
MinVersion string
|
TLSMinVersion string
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServerConfig represents the standard server TLS config.
|
// ServerConfig represents the standard server TLS config.
|
||||||
|
@ -71,13 +71,13 @@ func (c *ClientConfig) TLSConfig() (*tls.Config, error) {
|
||||||
tlsConfig.ServerName = c.ServerName
|
tlsConfig.ServerName = c.ServerName
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.MinVersion == "1.0" {
|
if c.TLSMinVersion == "1.0" {
|
||||||
tlsConfig.MinVersion = tls.VersionTLS10
|
tlsConfig.MinVersion = tls.VersionTLS10
|
||||||
} else if c.MinVersion == "1.1" {
|
} else if c.TLSMinVersion == "1.1" {
|
||||||
tlsConfig.MinVersion = tls.VersionTLS11
|
tlsConfig.MinVersion = tls.VersionTLS11
|
||||||
} else if c.MinVersion == "1.2" {
|
} else if c.TLSMinVersion == "1.2" {
|
||||||
tlsConfig.MinVersion = tls.VersionTLS12
|
tlsConfig.MinVersion = tls.VersionTLS12
|
||||||
} else if c.MinVersion == "1.3" {
|
} else if c.TLSMinVersion == "1.3" {
|
||||||
tlsConfig.MinVersion = tls.VersionTLS13
|
tlsConfig.MinVersion = tls.VersionTLS13
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue