simplify redis tls implementation (#606)

This commit is contained in:
Kevin Wan
2021-04-08 18:19:36 +08:00
committed by GitHub
parent 8cb6490724
commit 9963ffb1c1
5 changed files with 83 additions and 208 deletions

View File

@@ -20,10 +20,10 @@ func getClient(server, pass string) (*red.Client, error) {
return getClientWithTLS(server, pass, false)
}
func getClientWithTLS(server, pass string, tlsFlag bool) (*red.Client, error) {
func getClientWithTLS(server, pass string, tlsEnabled bool) (*red.Client, error) {
val, err := clientManager.GetResource(server, func() (io.Closer, error) {
var tlsConfig *tls.Config = nil
if tlsFlag {
var tlsConfig *tls.Config
if tlsEnabled {
tlsConfig = &tls.Config{
InsecureSkipVerify: true,
}