I'm deploying a flask app on Heroku using a Redis premium plan. I get the following error: 'SSL Certification Verify Failed'. Attempted fixes:
ssl_cert_reqs=None
to the Redis
constructor in redis-py
A solution to this problem could be:
From Heroku's docs, this may be a hint: 'you must enable TLS in your Redis client’s configuration in order to connect to a Redis 6 database'. I don't understand what this means.
Heroku Data for Redis is an in-memory key-value data store, run by Heroku, that is provisioned and managed as an add-on. Heroku Data for Redis is accessible from any language with a Redis driver, including all languages and frameworks supported by Heroku.
Reliable and powerful Redis as a service. Starting at $0/mo.
You can disable TLS certification on Heroku by downgrading to Redis 5 and passing ssl_cert_reqs=None
to the Redis
constructor.
$ heroku addons:create heroku-redis:premium-0 --version 5
from redis import ConnectionPool, Redis
import os
connection_pool = ConnectionPool.from_url(os.environ.get('REDIS_URL'))
app.redis = Redis(connection_pool=connection_pool, ssl_cert_reqs=None)
My mistake was not doing both at the same time.
An ideal solution would explain how to configure TLS certification for Redis 6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With