Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redisTLS configuration support when using go-redis #4284

Open
MinerYang opened this issue Feb 23, 2024 · 1 comment
Open

redisTLS configuration support when using go-redis #4284

MinerYang opened this issue Feb 23, 2024 · 1 comment
Labels
area/cache area/config Related to registry config

Comments

@MinerYang
Copy link

MinerYang commented Feb 23, 2024

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 createPoolwhen new Redis client
  • Besides, could we consider to add something likeRedis.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
	})
}
@MinerYang MinerYang changed the title redisTLS configuration support redisTLS configuration support when using go-redis Feb 23, 2024
@milosgajdos milosgajdos added area/config Related to registry config area/cache labels Mar 2, 2024
@milosgajdos
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cache area/config Related to registry config
Projects
None yet
Development

No branches or pull requests

2 participants