Skip to content

Commit

Permalink
Fixbug init failed useing aws ssl cluster (#70)
Browse files Browse the repository at this point in the history
* fixbug: initiation error of aws cluster client caused by not appropiate function list used

* fix bug: use `ssl_context` instead of ssl_keyfile,ssl_certfile,ssl_cert_reqs,ssl_ca_certs in intialization of connection_pool
  • Loading branch information
NoneGG authored Feb 2, 2018
1 parent 1d1ad1b commit 613d3db
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions aredis/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 613d3db

Please sign in to comment.