Skip to content

Conversation

@majiayu000
Copy link
Contributor

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
Contributor 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.

Copy link
Collaborator

@petyaslavova petyaslavova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@petyaslavova petyaslavova merged commit 201c3c9 into redis:master Dec 15, 2025
40 checks passed
@majiayu000 majiayu000 deleted the fix/3414-async-ssl-ca-path branch December 15, 2025 09:47
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