Heroku Redis 上的 SSL 认证验证失败 [英] SSL Certification Verify Failed on Heroku Redis
问题描述
我正在使用 Redis 高级计划在 Heroku 上部署一个 Flask 应用程序.我收到以下错误:SSL 认证验证失败".尝试修复:
I'm deploying a flask app on Heroku using a Redis premium plan. I get the following error: 'SSL Certification Verify Failed'. Attempted fixes:
- 降级到 Redis 5
- 将
ssl_cert_reqs=None
传递给redis-py
中的
Redis
构造函数此问题的解决方案可能是:
A solution to this problem could be:
- 解释如何在 heroku redis 高级计划中禁用 TLS 认证
- 解释如何使 TLS 认证适用于 heroku redis 高级计划
从 Heroku 的文档中,这可能是一个提示:您必须在 Redis 客户端的配置中启用 TLS 才能连接到 Redis 6 数据库".我不明白这是什么意思.
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.
推荐答案
您可以通过降级到 Redis 5 并将 ssl_cert_reqs=None
传递给 Redis
来禁用 Heroku 上的 TLS 认证> 构造函数.
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.
一个理想的解决方案将解释如何为 Redis 6 配置 TLS 认证.
An ideal solution would explain how to configure TLS certification for Redis 6.
这篇关于Heroku Redis 上的 SSL 认证验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!