From c388dc48cb5243a50f1716b2c59f7f77ca0bbdab Mon Sep 17 00:00:00 2001 From: Jeff Hubbard Date: Thu, 1 Nov 2018 12:37:15 -0700 Subject: [PATCH] Adding option for TLS config in redis checker --- checkers/redis.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/checkers/redis.go b/checkers/redis.go index ff9713a..19d4031 100644 --- a/checkers/redis.go +++ b/checkers/redis.go @@ -1,6 +1,7 @@ package checkers import ( + "crypto/tls" "fmt" "time" @@ -38,6 +39,8 @@ type RedisAuthConfig struct { Addr string // `host:port` format Password string // leave blank if no password DB int // leave unset if no specific db + + TLS *tls.Config // TLS config in case we are using in-transit encryption } // RedisSetOptions contains attributes that can alter the behavior of the redis @@ -89,6 +92,8 @@ func NewRedis(cfg *RedisConfig) (*Redis, error) { Addr: cfg.Auth.Addr, Password: cfg.Auth.Password, // no password set DB: cfg.Auth.DB, // use default DB + + TLSConfig: cfg.Auth.TLS, }) if _, err := c.Ping().Result(); err != nil {