Skip to content

fix: redis SSL kwargs incompatible with redis-py 7.x#55

Merged
aron-muon merged 1 commit intomainfrom
aron/fix-redis-issue
Apr 12, 2026
Merged

fix: redis SSL kwargs incompatible with redis-py 7.x#55
aron-muon merged 1 commit intomainfrom
aron/fix-redis-issue

Conversation

@aron-muon
Copy link
Copy Markdown
Owner

@aron-muon aron-muon commented Apr 12, 2026

Summary

Fixes AbstractConnection.__init__() got an unexpected keyword argument 'ssl_context' crash on startup introduced in #54.

The previous change replaced individual ssl_* kwargs with a single ssl_context object, but redis-py 7.x's SSLConnection does not accept ssl_context — it expects individual parameters (ssl_ca_certs, ssl_certfile, etc.).

Closes #53 (remaining fix from #54)

Changes

src/config/redis.py

  • Removed _build_ssl_context() and the import ssl it required (which also shadowed the ssl field name)
  • get_ssl_kwargs() now returns individual ssl_* parameters compatible with redis-py 7.x
  • Key fix: None-valued params (ssl_ca_certs, ssl_certfile, ssl_keyfile) are now omitted rather than passed explicitly, so unset fields fall back to redis-py defaults (e.g. system CA bundle) instead of overriding them

tests/unit/test_redis_config.py

  • Rewrote SSL tests to verify the actual kwargs shape (individual params, not ssl_context)
  • Added test_ssl_kwargs_accepted_by_connection_pool which creates a real redis.ConnectionPool.from_url() with the spread kwargs — this would have caught the original bug
  • Added tests for None-omission behavior (test_ssl_omits_none_ca_certs, test_ssl_omits_none_certfile)

Test plan

  • All 1332 unit tests pass (just test-unit)
  • Linter passes (just lint)
  • test_ssl_kwargs_accepted_by_connection_pool validates kwargs against real redis-py API
  • Deploy with Redis TLS + custom CA cert

🤖 Generated with Claude Code

@aron-muon aron-muon changed the title fix: redis kwargs fix: redis SSL kwargs incompatible with redis-py 7.x Apr 12, 2026
@aron-muon aron-muon marked this pull request as ready for review April 12, 2026 14:02
@aron-muon aron-muon merged commit e248070 into main Apr 12, 2026
29 checks passed
@aron-muon aron-muon deleted the aron/fix-redis-issue branch April 12, 2026 14:02
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 3.3.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native Custom CA Support for Redis and MinIO

1 participant