Skip to content

Error: Config: Redis: can't connect with TLS, the feature is not enabled- InvalidClientConfig #420

@pakinming

Description

@pakinming

🐛 Bug Report

Description

When attempting to connect to a Redis server over TLS, I encounter the following error:

Error: Config: Redis: can't connect with TLS, the feature is not enabled - InvalidClientConfig

This occurs despite enabling the tokio-native-tls-comp feature in redis and using deadpool-redis.


🔧 Reproduction Steps

  1. Add dependencies:
# Cargo.toml
redis = { version = "0.32.0", features = ["tokio-native-tls-comp"] }
deadpool-redis = "0.21.1"
rustls = { version = "0.23" }
  1. Initialize rustls and try to connect:
rustls::crypto::ring::default_provider()
    .install_default()
    .expect("Failed to install rustls crypto provider");

debug!("redis url: {}", settings.database.redis_url);
let cfg = Config::from_url(&settings.database.redis_url);
let pool = cfg.create_pool(Some(deadpool_redis::Runtime::Tokio1))?;
  1. Use a Redis URL with TLS:
rediss://your-hostname:port
  1. ✅ The connection succeeds without TLS (i.e., using a redis://)

⚠️ Expected Behavior

Should connect to Redis using TLS successfully.


💡 Actual Behavior

Fails with the following error:

Error: Config: Redis: can't connect with TLS, the feature is not enabled - InvalidClientConfig

🙏 Request

  • Is tokio-native-tls-comp sufficient for enabling TLS support?
  • Does deadpool-redis support TLS connections through this configuration?
  • If not, what is the correct way to enable Redis TLS support with deadpool-redis?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-redisArea: Redis / deadpool-redisdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions