Skip to content

feat: add TLS support #79

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

vijaytdh
Copy link

Added support for enabling TLS connections to Redis. This allows users of this package to enhance security.

Thanks to the work that @appleboy already did in this PR this only involves adding some extra options 🙏

I have tested this locally with an application that uses this package (it uses NewRediStoreWithDB) and gorilla sessions (by updating go.mod to replace the official version with my local version, and building it) and Azure Redis Cache.

@vijaytdh
Copy link
Author

vijaytdh commented Mar 30, 2025

One question, some Redis server implementations that support TLS, such as Google Memory Store for Redis, require that you load their CA certificate otherwise verification fails as it is not signed by another well-known/trusted root CA that would already be in the trust store.

If I were to update this MR or create a new one to support this scenario, what would be the most acceptable way to do this?
I was thinking to offload this to the caller so they have to create a tls.Config and pass this in as opposed to having the caller pass a slice of strings and then creating a certPool etc. Happy to move this into a separate PR and discuss there.

@vijaytdh
Copy link
Author

vijaytdh commented Apr 2, 2025

Apologies I forgot to update the tests, I have now updated them to pass in the new args and fixed the conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant