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

Support SSL connections #87

Closed
wants to merge 3 commits into from
Closed

Conversation

stanhu
Copy link
Contributor

@stanhu stanhu commented Aug 10, 2022

To do:

  1. Currently if SSL peer verification fails, this C extension seg faults in rb_sys_fail(0). This C extension should never seg fault.
  2. Disable SSL peer verification if no certificates are configured. Requires Make it possible to set SSL verify mode hiredis#1085.
  3. Update vendored hiredis-rb with those changes.
  4. Update redis-rb with this change:
diff --git a/lib/redis/connection/hiredis.rb b/lib/redis/connection/hiredis.rb
index 1dbb6a3..5d23600 100644
--- a/lib/redis/connection/hiredis.rb
+++ b/lib/redis/connection/hiredis.rb
@@ -15,6 +15,8 @@ class Redis
 
         if config[:scheme] == "unix"
           connection.connect_unix(config[:path], connect_timeout)
+        elsif config[:scheme] == "rediss" || config[:ssl]
+          connection.connect_ssl(config[:host], config[:port], connect_timeout, config[:ssl_params])
         else
           connection.connect(config[:host], config[:port], connect_timeout)
         end

stanhu added 3 commits August 9, 2022 22:55
In preparation for supporting the redis:// scheme, build the hiredis
gem with SSL enabled by default. This can be disabled with
`--without-ssl`.
@stanhu stanhu marked this pull request as draft August 10, 2022 16:48
@stanhu stanhu changed the title Draft: Support SSL connections Support SSL connections Aug 10, 2022
@stanhu
Copy link
Contributor Author

stanhu commented Aug 10, 2022

I'm going to abandon efforts on this since redis-client fixes all the issues I identified with hiredis-rb: #58 (comment)

@stanhu stanhu closed this Aug 10, 2022
@stanhu stanhu reopened this Aug 12, 2022
@stanhu
Copy link
Contributor Author

stanhu commented Aug 23, 2022

Closing because redis-rb v5.0 will have hiredis support, and this pull request would need changes for redis-rb in any case.

@stanhu stanhu closed this Aug 23, 2022
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

Successfully merging this pull request may close these issues.

1 participant