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 Client support #570

Closed
wants to merge 8 commits into from
Closed

SSL Client support #570

wants to merge 8 commits into from

Conversation

mnunberg
Copy link
Contributor

@mnunberg mnunberg commented Jan 9, 2018

This provides SSL client support for communicating with an SSL-secured Redis implementation. The user-facing API is exposed as bolted-on, which makes modifying existing applications easier. This works in my basic testing so far.

The SSL implementation assumes mutual TLS auth. SSL support is disabled by default at compilation. To use SSL, set USE_SSL in the build environment.

$make USE_SSL=1

This should enable the HIREDIS_SSL preprocessor define, which should enable the SSL bits. Note that you may want to also adjust your OPENSSL_PREFIX build variable to your desired openssl installation. This is probably only a concern for OSX where there are typically both Homebrew and Apple variants provided. On linux there should only be a single version found in /usr/lib/ or similar. The default value is /opt/local/openssl.

Once the library is built, you should be able to call

int redisSecureConnection(redisContext *c, const char *capath, const char *certpath,
                          const char *keypath);

On the connection. This will perform openssl negotiation. The reason I didn't provide another variant of redisConnect is twofold. (1) I wanted other applications to be able to simply add (rather than change) their existing connection code - so this also works via fd etc. (2) Users can quickly debug if an error is coming from the connection layer or openssl layer.

I've also added examples (the sync example and the libev and libevent examples).

@mnunberg mnunberg mentioned this pull request Sep 8, 2018
@mnunberg
Copy link
Contributor Author

@michael-grunder Any thoughts on this? I've been asked to revive this

@michael-grunder
Copy link
Collaborator

I'm not opposed to adding SSL support.

There was a great deal of back and forth around this issue in Redis proper, so we may want to run it by @antirez to see if he has any objections.

I'm happy to help test as well.

@drpalaric
Copy link

Is there any future for this?

@mnunberg
Copy link
Contributor Author

mnunberg commented Jan 25, 2019 via email

@mnunberg
Copy link
Contributor Author

I'm closing this PR in favor of #645

@mnunberg mnunberg closed this Feb 20, 2019
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.

3 participants