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

Does Client struct support TLS? #975

Closed
omer-shtivi opened this issue Oct 11, 2023 · 4 comments
Closed

Does Client struct support TLS? #975

omer-shtivi opened this issue Oct 11, 2023 · 4 comments

Comments

@omer-shtivi
Copy link

Hello,
I need to support both TLS and authentication to a redis which isn't a cluster, is it supported?
I don't see a tls method on the Client struct.

@omer-shtivi
Copy link
Author

You can set it up with rediss:// when calling the open()

@JonasMS
Copy link

JonasMS commented Oct 20, 2023

@omer-shtivi I'm getting the following error when trying to use TLS by using rediss://:

can't connect with TLS, the feature is not enabled- InvalidClientConfig

Using the tls feature (which isn't listed in the docs) doesn't fix this
i.e. redis = { version = "0.23.3", features = ["tls"] }

Do you know how I can fix this?

@omer-shtivi
Copy link
Author

@JonasMS you need also to use feature tokio-native-tls-comp (if you are using tokio) or tokio-rustls-comp, or async-std-tls-comp

@paul-asvb
Copy link

paul-asvb commented Dec 16, 2023

This worked for me in axum:

redis = { version = "0.24.0", features = [
    "tls",
    "aio",
    "tls-native-tls",
    "tokio-native-tls",
    "tokio-native-tls-comp",
    "tokio-comp",
] }

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

No branches or pull requests

3 participants