在启用 TLS(传输中加密)的情况下连接到 ElastiCache Redis

我们的 Discourse 使用了在 Amazon ElastiCache 中创建的 Redis 集群,该集群支持启用传输加密(TLS)。然而,一旦我们在 ElastiCache 上启用 TLS,Discourse 就无法连接到 Redis。

看起来 Discourse 尚不支持此功能,尽管 redis-rb 客户端支持,正如在类似问题中提到的:Redis::ConnectionError: Connection lost (ECONNRESET) when using ElastiCache with TLS enabled · Issue #771 · redis/redis-rb · GitHub

2 个赞

I’m adding pr-welcome on that. Feel free to submit one @Yevhenii_Baraniuk :wink:

3 个赞

Update: I started implementing this feature but faced the problem that hiredis driver which Discourse uses doesn’t support SSL at the moment (as for Jul 2019), though redis-rb client does. I’ll come back to the PR once the new version of hiredis is released which is going to support SSL :slight_smile:

4 个赞

由于 @sam 的贡献,hiredis 已不再维护,因此我创建了这个 PR,为我们的 Redis 连接添加了 TLS 功能:

我正在测试,目前运行正常。

4 个赞