diff --git a/aredis/client.py b/aredis/client.py index b9c7dba4..f9e55c4f 100644 --- a/aredis/client.py +++ b/aredis/client.py @@ -18,7 +18,7 @@ from aredis.commands.sorted_set import SortedSetCommandMixin, ClusterSortedSetCommandMixin from aredis.commands.strings import StringsCommandMixin, ClusterStringsCommandMixin from aredis.commands.transaction import TransactionCommandMixin, ClusterTransactionCommandMixin -from aredis.connection import UnixDomainSocketConnection +from aredis.connection import UnixDomainSocketConnection, RedisSSLContext from aredis.exceptions import ( ConnectionError, TimeoutError, RedisClusterException, MovedError, @@ -108,7 +108,7 @@ def __init__(self, host='localhost', port=6379, ssl_keyfile=None, ssl_certfile=None, ssl_cert_reqs=None, ssl_ca_certs=None, max_connections=None, retry_on_timeout=False, - *, loop=None): + loop=None, **kwargs): if not connection_pool: kwargs = { 'db': db, @@ -135,12 +135,8 @@ def __init__(self, host='localhost', port=6379, }) if ssl: - kwargs.update({ - 'ssl_keyfile': ssl_keyfile, - 'ssl_certfile': ssl_certfile, - 'ssl_cert_reqs': ssl_cert_reqs, - 'ssl_ca_certs': ssl_ca_certs, - }) + ssl_context = RedisSSLContext(ssl_keyfile, ssl_certfile, ssl_cert_reqs, ssl_ca_certs).get() + kwargs['ssl_context'] = ssl_context connection_pool = ConnectionPool(**kwargs) self.connection_pool = connection_pool self._use_lua_lock = None