Due to a recent update, I need to be able to set the verify mode of Redis to verify none.
The output of Resque.redis.ping
OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate in certificate chain))
I have tried the following
# /config/initializers/redis.rb
Resque.redis = Redis.new(url: ENV["REDIS_URL"], ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE })
# /config/resque.yml
development: localhost:6379
production:
url: <%= ENV['REDIS_URL'] %>
ssl_params:
verify_mode: OpenSSL::SSL::VERIFY_NONE
If I manually replace the redis via CLI it will work, but the workers are not getting initialized with a proper Redis config.
irb(main):002:0> Resque.redis = Redis.new(url: ENV["REDIS_URL"], ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE })
=> #<Redis client v4.8.0 for rediss://URL>
irb(main):003:0> Resque.redis.ping
=> "PONG"
In the interim, I can make things work by changing the resque initializer but it is completely ignoring the resque.yml and it feels yucky.
rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..'
rails_env = ENV['RAILS_ENV'] || 'development'
config_file = rails_root + '/config/resque.yml'
resque_config = YAML::load(ERB.new(IO.read(config_file)).result)
#Resque.redis = resque_config[rails_env]
Resque.redis = Redis.new(url: ENV["REDIS_URL"], ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE })