Skip to content

Commit 3def161

Browse files
authored
Added ssl_check_hostname query param for redis 6.0 (#4540)
Redis 6.0 switches the default of `ssl_check_hostname` from False to True (see breaking changes [here](https://github.com/redis/redis-py/releases/tag/v6.0.0), so an extra URL param is required. This came up for me locally as well as on the [test instance](https://otf.sentry.io/issues/6595117738/events/0a22d20ea8d94823a583b395fe921e7f/)
1 parent 00f9150 commit 3def161

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

hypha/settings/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,10 @@
510510
if REDIS_URL and not (CELERY_BROKER_URL or CELERY_RESULT_BACKEND):
511511
cert_param = ""
512512
if REDIS_URL.startswith("rediss") and REDIS_SSL_CERT_REQS:
513-
cert_param = f"?ssl_cert_reqs={REDIS_SSL_CERT_REQS}"
513+
check_hostname = str(REDIS_SSL_CERT_REQS != "CERT_NONE").lower()
514+
cert_param = (
515+
f"?ssl_cert_reqs={REDIS_SSL_CERT_REQS}&ssl_check_hostname={check_hostname}"
516+
)
514517
CELERY_BROKER_URL = f"{REDIS_URL}/0{cert_param}"
515518
CELERY_RESULT_BACKEND = f"{REDIS_URL}{cert_param}"
516519
# Manipulation of the environ vars is needed due to how celery processes & prioritizes settings

0 commit comments

Comments
 (0)