redis-rb icon indicating copy to clipboard operation
redis-rb copied to clipboard

SSL not supported by hiredis driver message

Open razasayed opened this issue 3 years ago • 5 comments

Im using the latest version of redis-rb which is version 4.6.0 and also of hiredis gem, version 0.6.3. Im trying to connect to a Redis cluster in AWS which has in transit encryption enabled as follows:

client = Redis.new(url: 'the url here', ssl: true)

I get the following response:

NotImplementedError (SSL not supported by hiredis driver)

Also, trying to do client = Redis.new(url: 'the url here', ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE }) leads to a Connection Timeout.

I saw that hiredis C library has enabled SSL support (https://github.com/redis/hiredis/pull/645 ). However, is SSL support still not available in the ruby version ?. Is there any other way to get SSL working with redis in ruby ?

razasayed avatar Mar 04 '22 09:03 razasayed

It seems that we are not ready to use the feature yet.

https://github.com/redis/redis-rb/blob/4e76b035a98ce2c7bd7666a1553fc4394279ca83/lib/redis/connection/hiredis.rb#L12-L29

  • #828
  • #1077
  • https://github.com/redis/hiredis-rb/issues/58
  • https://github.com/redis/hiredis-rb/pull/72

supercaracal avatar Mar 04 '22 10:03 supercaracal

You can use the default connector. https://github.com/redis/redis-rb/blob/master/lib/redis/connection/ruby.rb

supercaracal avatar Mar 04 '22 22:03 supercaracal

It seems that we are not ready to use the feature yet.

https://github.com/redis/redis-rb/blob/4e76b035a98ce2c7bd7666a1553fc4394279ca83/lib/redis/connection/hiredis.rb#L12-L29

@supercaracal In master branch that line has been removed https://github.com/redis/redis-rb/commit/86df222e80e813127592d9bc9e0bc463a3d11a0d because hiredis now supports ssl. But redis-rb still not working with ssl when using hiredis driver.

razasayed avatar Mar 07 '22 10:03 razasayed

@razasayed hiredis supports SSL in versions > 1.0 it seems https://github.com/redis/hiredis/blob/master/CHANGELOG.md#100---2020-08-03

BobbyMcWho avatar Mar 24 '22 15:03 BobbyMcWho

To be clear, hiredis supports SSL, but hiredis-rb does NOT yet support this. https://github.com/redis/redis-rb/pull/1077 should be reverted.

See the ongoing work in https://github.com/redis/hiredis-rb/issues/58#issuecomment-1210983319.

stanhu avatar Aug 10 '22 17:08 stanhu

5.0 now rely on redis-client which does have an hiredis driver with SSL support. So closing.

byroot avatar Aug 17 '22 19:08 byroot