added ssl support for sentinel connections (#1649)

Co-authored-by: Christian Schläppi <cschlaeppi@hosttech.ch>
main
nevious 3 years ago committed by GitHub
parent f2a3e8d346
commit 5eb2f0b9a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -52,7 +52,12 @@ def get_redis_from_config(settings, connection_class=Redis):
password = settings['SENTINEL'].get('PASSWORD', None)
db = settings['SENTINEL'].get('DB', 0)
master_name = settings['SENTINEL'].get('MASTER_NAME', 'mymaster')
sn = Sentinel(instances, socket_timeout=socket_timeout, password=password, db=db)
ssl = settings['SENTINEL'].get('SSL', False)
arguments = {'password': password, 'ssl': ssl}
sn = Sentinel(
instances, socket_timeout=socket_timeout, password=password,
db=db, ssl=ssl, sentinel_kwargs=arguments
)
return sn.master_for(master_name)
ssl = settings.get('REDIS_SSL', False)

Loading…
Cancel
Save