Skip to content

SSL Client support#570

Closed
mnunberg wants to merge 8 commits intoredis:masterfrom
mnunberg:ssl
Closed

SSL Client support#570
mnunberg wants to merge 8 commits intoredis:masterfrom
mnunberg:ssl

Conversation

@mnunberg
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@michael-grunder
Copy link
Copy Markdown
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
Copy Markdown

Is there any future for this?

@mnunberg
Copy link
Copy Markdown
Contributor Author

mnunberg commented Jan 25, 2019 via email

@mnunberg
Copy link
Copy Markdown
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.

4 participants