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

Implement ssl_ca_path argument for async Redis client #3414

Open
tyler-8 opened this issue Oct 14, 2024 · 2 comments
Open

Implement ssl_ca_path argument for async Redis client #3414

tyler-8 opened this issue Oct 14, 2024 · 2 comments

Comments

@tyler-8
Copy link

tyler-8 commented Oct 14, 2024

Version: redis-py 5.0.3

Platform: Ubuntu 22

Description: The sync redis client supports the ssl_ca_path argument to point to a directory of certificate authority certs. However, the async redis client does not support this argument. The workarounds for this are messy or come with their own challenges and the best solution would be for the async and sync clients to match.

@Gerioso
Copy link

Gerioso commented Oct 16, 2024

I solved this problem by using :
1)cluster

        from redis.asyncio import RedisCluster
        from redis.asyncio.cluster import ClusterNode
        pool = RedisCluster(
        startup_nodes=cluster_hosts,
        password=*redis_password*,
        ssl=True,
        ssl_ca_certs=* ssl_ca_path*,
        decode_responses=True,
    ) 

2)pool

    pool = ConnectionPool(
        host= redis_host,
        port=redis_port,
        password=redis_password,
        db=0,
        decode_responses=True,
        connection_class=SSLConnection,
        ssl_ca_certs=ssl_ca_path,
    )

@tyler-8
Copy link
Author

tyler-8 commented Oct 17, 2024

I solved this problem by using...

The ssl_ca_certs argument is passed into the cafile argument in context.load_verify_locations(cafile=self.ca_certs, cadata=self.ca_data) which expects a single file, not a directory.

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

2 participants