Skip to content

Conversation

@majiayu000
Copy link

Summary

Fixes #3347

Add ssl_password parameter to the async Redis client and SSLConnection to enable using encrypted private keys, matching the sync client's functionality.

Changes

  • Add ssl_password parameter to Redis.__init__
  • Add ssl_password parameter to SSLConnection.__init__
  • Add password parameter to RedisSSLContext
  • Pass password to ssl.SSLContext.load_cert_chain()

Usage

from redis.asyncio import Redis

client = Redis(
    host="localhost",
    ssl=True,
    ssl_keyfile="/path/to/encrypted.key",
    ssl_certfile="/path/to/cert.pem",
    ssl_password="your-key-password",
)

🤖 Generated with Claude Code

majiayu000 and others added 2 commits December 10, 2025 16:44
Add ssl_password parameter to the async Redis client and SSLConnection
to enable using encrypted private keys, matching the sync client's
functionality.

Changes:
- Add ssl_password parameter to Redis.__init__
- Add ssl_password parameter to SSLConnection.__init__
- Add password parameter to RedisSSLContext
- Pass password to ssl.SSLContext.load_cert_chain()

🤖 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! Would you please add some unit tests that cover the change?

Add test_ssl_password_parameter test to verify ssl_password is properly
passed through to SSLConnection for encrypted private key 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 added a unit test (test_ssl_password_parameter) in tests/test_asyncio/test_ssl.py to verify that ssl_password is properly passed through to SSLConnection.

Please let me know if you'd like any additional test coverage.

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_password is not supported at redis.asyncio.Redis constructor

2 participants