From 614ed283c04ce4eb6218a566cb12c5f7ab55be34 Mon Sep 17 00:00:00 2001 From: Ulric Qin Date: Fri, 22 Apr 2022 22:25:02 +0800 Subject: [PATCH] rename MinVersion to TLSMinVersion --- etc/server.conf | 2 +- etc/webapi.conf | 2 +- src/pkg/tls/config.go | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/etc/server.conf b/etc/server.conf index 8b33964a..8557c361 100644 --- a/etc/server.conf +++ b/etc/server.conf @@ -119,7 +119,7 @@ Address = "127.0.0.1:6379" # Password = "" # DB = 0 # UseTLS = false -# MinVersion = "1.2" +# TLSMinVersion = "1.2" [Gorm] # enable debug mode or not diff --git a/etc/webapi.conf b/etc/webapi.conf index 77806a2a..ddcd15b7 100644 --- a/etc/webapi.conf +++ b/etc/webapi.conf @@ -142,7 +142,7 @@ Address = "127.0.0.1:6379" # Password = "" # DB = 0 # UseTLS = false -# MinVersion = "1.2" +# TLSMinVersion = "1.2" [Gorm] # enable debug mode or not diff --git a/src/pkg/tls/config.go b/src/pkg/tls/config.go index 910c51a9..5dc0f127 100644 --- a/src/pkg/tls/config.go +++ b/src/pkg/tls/config.go @@ -18,7 +18,7 @@ type ClientConfig struct { TLSKeyPwd string InsecureSkipVerify bool ServerName string - MinVersion string + TLSMinVersion string } // ServerConfig represents the standard server TLS config. @@ -71,13 +71,13 @@ func (c *ClientConfig) TLSConfig() (*tls.Config, error) { tlsConfig.ServerName = c.ServerName } - if c.MinVersion == "1.0" { + if c.TLSMinVersion == "1.0" { tlsConfig.MinVersion = tls.VersionTLS10 - } else if c.MinVersion == "1.1" { + } else if c.TLSMinVersion == "1.1" { tlsConfig.MinVersion = tls.VersionTLS11 - } else if c.MinVersion == "1.2" { + } else if c.TLSMinVersion == "1.2" { tlsConfig.MinVersion = tls.VersionTLS12 - } else if c.MinVersion == "1.3" { + } else if c.TLSMinVersion == "1.3" { tlsConfig.MinVersion = tls.VersionTLS13 }