mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 20:37:12 +01:00
lib/netutil/tls.go: consistently use tlsMinVersion name across source code
This should simplify further code maintenance and refactoring
This is a follow-up after 6ab1cede62
This commit is contained in:
parent
6ab1cede62
commit
6411bbcce7
@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// GetServerTLSConfig returns TLS config for the server.
|
// GetServerTLSConfig returns TLS config for the server.
|
||||||
func GetServerTLSConfig(tlsCertFile, tlsKeyFile, minTLSVersion string, tlsCipherSuites []string) (*tls.Config, error) {
|
func GetServerTLSConfig(tlsCertFile, tlsKeyFile, tlsMinVersion string, tlsCipherSuites []string) (*tls.Config, error) {
|
||||||
var certLock sync.Mutex
|
var certLock sync.Mutex
|
||||||
var certDeadline uint64
|
var certDeadline uint64
|
||||||
var cert *tls.Certificate
|
var cert *tls.Certificate
|
||||||
@ -22,9 +22,9 @@ func GetServerTLSConfig(tlsCertFile, tlsKeyFile, minTLSVersion string, tlsCipher
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot use TLS cipher suites from tlsCipherSuites=%q: %w", tlsCipherSuites, err)
|
return nil, fmt.Errorf("cannot use TLS cipher suites from tlsCipherSuites=%q: %w", tlsCipherSuites, err)
|
||||||
}
|
}
|
||||||
minVersion, err := ParseTLSVersion(minTLSVersion)
|
minVersion, err := ParseTLSVersion(tlsMinVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannnot use TLS min version from minTLSVersion=%q. Supported TLS versions (TLS10, TLS11, TLS12, TLS13): %w", minTLSVersion, err)
|
return nil, fmt.Errorf("cannnot use TLS min version from tlsMinVersion=%q. Supported TLS versions (TLS10, TLS11, TLS12, TLS13): %w", tlsMinVersion, err)
|
||||||
}
|
}
|
||||||
cert = &c
|
cert = &c
|
||||||
cfg := &tls.Config{
|
cfg := &tls.Config{
|
||||||
|
Loading…
Reference in New Issue
Block a user