-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 Support Reorganization #705
Comments
As long as we make it possible (and make it the default) to have a single SSL library with SSL support, I'd be ok with it. I'm not sure though how you'd implement (4) without having a bunch of function pointers and using dlopen.. |
A bunch of function pointers yes, to facilitate a kind of run-time polymorphism on top of |
Wouldn't the intent be to allow ssl support to be added while not making it a dependency tax? |
@mnunberg yes, but the way I see it you'll be able to build hiredis into If you never use SSL, just link with And as you indicate, by default we can just build a single library with/without SSL support. But thinking about how this can get packaged for Linux distros etc, I think the core + SSL support approach is a clear winner. |
Oh, I see, that makes sense.
… On Aug 28, 2019, at 11:37 AM, Yossi Gottlieb ***@***.***> wrote:
@mnunberg <https://github.com/mnunberg> yes, but the way I see it you'll be able to build hiredis into hiredis.so (or a static lib of course) and hiredis_ssl.so.
If you never use SSL, just link with -lhiredis but you'll not have redisSecureConnection() etc.
If you want to use SSL, you need to link with -lhiredis -lhiredis_ssl -lssl -lcrypto and you'll have the SSL functions.
And as you indicate, by default we can just build a single library with/without SSL support. But thinking about how this can get packaged for Linux distros etc, I think the core + SSL support approach is a clear winner.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#705?email_source=notifications&email_token=AADKOUMZ33GYXLVXKSDZNEDQG2LSPA5CNFSM4IRJRJK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5LRMBY#issuecomment-525800967>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AADKOUIWOP5Y43MGMDO2YXTQG2LSPANCNFSM4IRJRJKQ>.
|
@mnunberg I'm tempted to make this the only option rather than complicate the Makefile and live in a world where hiredis.so could be with or without SSL support. It basically means if you need SSL you always have an extra |
@yossigo I think this would complicate the installation of the library. Think about how an example using SSL would work-- You'd need to add the rpath properly, and so on. I understand the concern that something like antirez/redis would have, but as I've mentioned before on other issues, hiredis is a simple enough library that people don't need to rely on our own Makefile-- it's provided there for convenience. In other words: if there is a more complex use case, you should handle it in redis, rather than push the solution "up" to hiredis. I'm not sure of many e.g. debian packages that split ssl and non-ssl support, unless there is some clear licensing issue, or if there is a dual-option with gnutls or openssl. |
@mnunberg Why would splitting I think the pattern of creating separate packages for SSL support is quite common, if you browse Debian repos you'll see it quite often. I also find it a good fit for hiredis because until the last official release it didn't support SSL, so providing it as a complementary library would be the natural thing to do from a backward compatibility point of view. Did you take a look at the draft PR to get a feel of how it looks like? You can see how it affects the examples. |
Done in #708. |
Here are some thoughts about reorganizing SSL support in hiredis.
redisUseSSL(redisContext *, SSL*)
function to let callers supply a pre-configuredSSL*
context and thus have full control over OpenSSL configuration options.redisSecureConnection()
does now and may cause conflicts with other users of OpenSSL.To achieve [3] and [4] I think
sslio.c
can becomessl.c
and be self contained. The use of theREDIS_SSL
flag to determine which read/write functions should be used can be replaced with simple function callbacks, and so can the use ofstruct redisSsl
so the rest of hiredis is completely decoupled from the SSL implementation.@mnunberg does this make sense to you?
The text was updated successfully, but these errors were encountered: