Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL not supported by hiredis driver message #1087

Closed
razasayed opened this issue Mar 4, 2022 · 6 comments
Closed

SSL not supported by hiredis driver message #1087

razasayed opened this issue Mar 4, 2022 · 6 comments

Comments

@razasayed
Copy link

razasayed commented Mar 4, 2022

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 (redis/hiredis#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 ?

@supercaracal
Copy link
Contributor

supercaracal commented Mar 4, 2022

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

def self.connect(config)
connection = ::Hiredis::Connection.new
connect_timeout = (config.fetch(:connect_timeout, 0) * 1_000_000).to_i
if config[:scheme] == "unix"
connection.connect_unix(config[:path], connect_timeout)
elsif config[:scheme] == "rediss" || config[:ssl]
raise NotImplementedError, "SSL not supported by hiredis driver"
else
connection.connect(config[:host], config[:port], connect_timeout)
end
instance = new(connection)
instance.timeout = config[:read_timeout]
instance
rescue Errno::ETIMEDOUT
raise TimeoutError
end

@supercaracal
Copy link
Contributor

@razasayed
Copy link
Author

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

def self.connect(config)
connection = ::Hiredis::Connection.new
connect_timeout = (config.fetch(:connect_timeout, 0) * 1_000_000).to_i
if config[:scheme] == "unix"
connection.connect_unix(config[:path], connect_timeout)
elsif config[:scheme] == "rediss" || config[:ssl]
raise NotImplementedError, "SSL not supported by hiredis driver"
else
connection.connect(config[:host], config[:port], connect_timeout)
end
instance = new(connection)
instance.timeout = config[:read_timeout]
instance
rescue Errno::ETIMEDOUT
raise TimeoutError
end

@supercaracal In master branch that line has been removed 86df222 because hiredis now supports ssl. But redis-rb still not working with ssl when using hiredis driver.

@BobbyMcWho
Copy link

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

@stanhu
Copy link

stanhu commented Aug 10, 2022

To be clear, hiredis supports SSL, but hiredis-rb does NOT yet support this. #1077 should be reverted.

See the ongoing work in redis/hiredis-rb#58 (comment).

@byroot
Copy link
Collaborator

byroot commented Aug 17, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants