From 537aaf4eaf20e9460804d279f8086da1856c1be6 Mon Sep 17 00:00:00 2001 From: Tomasz Stachewicz Date: Fri, 18 Apr 2025 10:21:54 +0200 Subject: [PATCH] support for redis connection without ssl certificate verification --- lib/pubsubstub.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/pubsubstub.rb b/lib/pubsubstub.rb index 872fbf5..6be54ac 100644 --- a/lib/pubsubstub.rb +++ b/lib/pubsubstub.rb @@ -43,7 +43,7 @@ def redis=(client) end def new_redis - Redis.new(url: redis_url) + Redis.new(url: redis_url, ssl_params: redis_ssl_params) end def subscriber @@ -65,6 +65,16 @@ def report_errors handle_error(error) raise end + + def redis_ssl_params + if(ENV['REDIS_SSL_VERIFY'] == 'false') + { + verify_mode: OpenSSL::SSL::VERIFY_NONE + } + else + {} + end + end end self.logger = Logger.new(STDOUT)