Skip to content

Conversation

@majiayu000
Copy link

Summary

Fixes #3414

Add ssl_ca_path parameter to the async Redis client and SSLConnection to enable specifying a directory of CA certificates, matching the sync client's functionality.

Changes

  • Add ssl_ca_path parameter to Redis.__init__
  • Add ssl_ca_path parameter to SSLConnection.__init__
  • Add ca_path parameter to RedisSSLContext
  • Pass capath to ssl.SSLContext.load_verify_locations()

Usage

from redis.asyncio import Redis

client = Redis(
    host="localhost",
    ssl=True,
    ssl_ca_path="/path/to/ca/certs/directory",
)

🤖 Generated with Claude Code

Add ssl_ca_path parameter to the async Redis client and SSLConnection
to enable specifying a directory of CA certificates, matching the sync
client's functionality.

Changes:
- Add ssl_ca_path parameter to Redis.__init__
- Add ssl_ca_path parameter to SSLConnection.__init__
- Add ca_path parameter to RedisSSLContext
- Pass capath to ssl.SSLContext.load_verify_locations()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@petyaslavova
Copy link
Collaborator

Hi @majiayu000, thank you for your contribution!
Can you please add some tests to the change to cover the new input?
I also noticed that for the sync cluster client, it needs to be added to the REDIS_ALLOWED_KEYS tuple - would you please add it there as well?

petyaslavova and others added 2 commits December 10, 2025 18:07
- Add test_ssl_ca_path_parameter test to verify ssl_ca_path is properly
  passed through to SSLConnection
- Add ssl_ca_path to REDIS_ALLOWED_KEYS tuple in cluster.py for sync
  cluster client support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@majiayu000
Copy link
Author

Thanks for the review! I've addressed the feedback:

  1. Added test_ssl_ca_path_parameter test in tests/test_asyncio/test_ssl.py to verify the parameter is properly passed through to SSLConnection
  2. Added ssl_ca_path to REDIS_ALLOWED_KEYS tuple in redis/cluster.py for sync cluster client support

Please take another look when you have a chance.

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.

ssl_ca_path supported by sync client but not by async client

2 participants