fix: give the realtime Redis event bridge the same wildcard TLS options as the command pool, because it is a second connection that a managed Redis rejects and it is the one that delivers every realtime event (#453)

This commit is contained in:
Matthew Meszaros
2026-09-12 00:41:30 -07:00
committed by GitHub
parent a4f503f620
commit ca1c10ec72
@@ -24,7 +24,10 @@ defmodule Realtime.Redis.EventSubscriber do
def init(_opts) do
redis_url = Application.get_env(:realtime, :redis_url, "redis://localhost:6379/0")
case Redix.PubSub.start_link(redis_url) do
# Same TLS options as the command pool: a managed Redis presents a wildcard
# certificate that Erlang's default hostname check rejects, and this
# connection is the one that delivers every realtime event.
case Redix.PubSub.start_link(redis_url, Realtime.Redis.tls_opts(redis_url)) do
{:ok, conn} ->
{:ok, _ref} = Redix.PubSub.subscribe(conn, @channel, self())
Logger.info("Realtime Redis event bridge subscribing to '#{@channel}'")