Skip to content

Commit

Permalink
Merge pull request #55 from InVisionApp/redis_tls
Browse files Browse the repository at this point in the history
Adding option for TLS config in redis checker
  • Loading branch information
Jeff Hubbard authored Nov 1, 2018
2 parents 3156551 + c388dc4 commit d8238da
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions checkers/redis.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package checkers

import (
"crypto/tls"
"fmt"
"time"

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit d8238da

Please sign in to comment.