redisTLS configuration support when using go-redis
MinerYang opened this issue · 2 comments
MinerYang commented
Description
I have noticed that there's a PR added redisTLS configurations support before when still using redigo library.
But seems be ingore when migrating go go-redis by this commit .
- Since we already have configuration for redisTLS, we should add this to
createPool
when new Redis client - Besides, could we consider to add something like
Redis.TLS.CaCert
to allow users connect with certs.
func (app *App) createPool(cfg configuration.Redis) *redis.Client {
return redis.NewClient(&redis.Options{
Addr: cfg.Addr,
OnConnect: func(ctx context.Context, cn *redis.Conn) error {
res := cn.Ping(ctx)
return res.Err()
},
Username: cfg.Username,
...
TLSConfig: cfg.TLS
})
}
milosgajdos commented
Great catch, thanks. Would you be willing to open a PR? I think we might need 2 PRs actually
- fix the TLS when creating a new pool (bugfix)
- add configuration support for custom CAs
milosgajdos commented
Closing, addressed in #4306