Skip to content

A platform for community discussion. Free, open, simple.

FIX: cache_critical_dns - add TLS support for Redis healthcheck

Michael Fitz-Payne0784c2870281
diff --git a/script/cache_critical_dns b/script/cache_critical_dns
index 552d11b90bb..f496230e7ec 100755
--- a/script/cache_critical_dns
+++ b/script/cache_critical_dns
@@ -116,11 +116,18 @@ class HealthyCache
end
def redis_healthcheck(host:, password:)
- client = Redis.new(
+ client_opts = {
host: host,
password: password,
timeout: 1,
- )
+ }
+ if !nilempty(ENV['DISCOURSE_REDIS_USE_SSL']).nil? then
+ client_opts[:ssl] = true
+ client_opts[:ssl_params] = {
+ verify_mode: OpenSSL::SSL::VERIFY_NONE,
+ }
+ end
+ client = Redis.new(**client_opts)
response = client.ping
response == "PONG"
rescue