Skip to content

Commit

Permalink
Merge pull request #1118 from redis/revert-1077-remove-error-caused-b…
Browse files Browse the repository at this point in the history
…y-hiredis-ssl-not-supported

Revert "Remove error caused by hiredis ssl not supported"
  • Loading branch information
byroot committed Aug 10, 2022
2 parents ce3f301 + e07a66e commit a48d002
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/redis/connection/hiredis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def self.connect(config)

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
Expand Down
11 changes: 11 additions & 0 deletions test/ssl_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ def test_ssl_blocking
end
end

driver(:hiredis, :synchrony) do
def test_ssl_not_implemented_exception
assert_raises(NotImplementedError) do
RedisMock.start({ ping: proc { "+PONG" } }, ssl_server_opts("trusted")) do |port|
redis = Redis.new(port: port, ssl: true, ssl_params: { ca_file: ssl_ca_file })
redis.ping
end
end
end
end

private

def ssl_server_opts(prefix)
Expand Down

0 comments on commit a48d002

Please sign in to comment.