Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSL Certification Verify Failed on Heroku Redis

I'm deploying a flask app on Heroku using a Redis premium plan. I get the following error: 'SSL Certification Verify Failed'. Attempted fixes:

  • Downgrading to Redis 5
  • Passing ssl_cert_reqs=None to the Redis constructor in redis-py

A solution to this problem could be:

  1. Explain how to disable TLS certification on heroku redis premium plans
  2. Explain how to make TLS certification work on heroku redis premium plans

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.

like image 810
Dillon Bowen Avatar asked Nov 27 '20 18:11

Dillon Bowen


People also ask

Does Redis work on Heroku?

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.

Is Redis heroku free?

Reliable and powerful Redis as a service. Starting at $0/mo.


1 Answers

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.

like image 152
Dillon Bowen Avatar answered Oct 07 '22 08:10

Dillon Bowen