Redis SSL
zN3utr4l opened this issue · comments
You cannot pass connection_class to use ssl/tls.
REDIS_URL = f'redis://default:{REDIS_PASSWORD}@{REDIS_HOST}:{REDIS_PORT}'
if REDIS_SSL.lower() in ['true', 't', 'y', 'yes']:
REDIS_URL += f'?connection_class={SSLConnection}&ssl_keyfile={REDIS_KEY}&ssl_certfile={REDIS_CERT}&ssl_ca_certs={REDIS_CA_CERT}'
else:
REDIS_URL += f'?connection_class={Connection}'
Traceback (most recent call last):
File "D:\Users\g.chirico\micromamba\envs\production\lib\site-packages\health_check\contrib\redis\backends.py", line 25, in check_status
conn.ping() # exceptions may be raised upon ping
File "D:\Users\g.chirico\micromamba\envs\production\lib\site-packages\redis\commands\core.py", line 1216, in ping
return self.execute_command("PING", **kwargs)
File "D:\Users\g.chirico\micromamba\envs\production\lib\site-packages\redis\client.py", line 505, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
File "D:\Users\g.chirico\micromamba\envs\production\lib\site-packages\redis\connection.py", line 1068, in get_connection
connection = self.make_connection()
File "D:\Users\g.chirico\micromamba\envs\production\lib\site-packages\redis\connection.py", line 1108, in make_connection
return self.connection_class(**self.connection_kwargs)
TypeError: 'str' object is not callable
connection class must be passed as kwargs but in backends.py it is not possible to pass kwargs
rediss
solves the problem