-
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
Wrapping OpenSSL global state initialisation? #804
Comments
cc: @yossigo as you wrote the SSL layer and know it much better than I do 😄 |
I've just corrected a couple of wrong function names in my initial comment. Sorry for the confusion! |
I've spent some more time playing with hiredis & TLS in a personal project. Although I still think this could be a nice addition, now I see it won't be as useful as I initially thought. I'm closing the issue. Sorry for the noise and thank you all for the great work :) |
It wasn't too much noise at all! |
@carlosabalde Thanks for your input, just saw this now. I personally don't like But I'm not sure I understand your proposal -- can you please explain nevertheless? |
@yossigo, I think For example, I'm adding TLS support to a Varnish Cache module using
I could use
That was the original motivation for this case. Hope it helps to understand a little bit the scenario. |
@carlosabalde Thanks! This is all clear of course, and it's exactly why I tend to think the apparent simplicity of Note that it's not only the fact that it performs its own OpenSSL initialization, but also how this initialization is performed. For example, on older versions of OpenSSL you need to register locks callbacks for thread safety. An alternative approach could be:
Does this make sense? |
I like it. A single entry point ( |
Sounds good to me, and like you said there are no backward compatibility issues since we haven't yet released a version with SSL support. If we do decide to make the changes we should do them before v1.0.0 when our options become far more limited. |
@michael-grunder 1.0.0 is definitely the point of no return on this, I wasn't sure about the amount of exposure the current SSL API has even as it was never officially released. @valentinogeron As we've also discussed this ourselves, does that make sense to you as well? |
I can't imagine it would cause too much pain, but I'm confident our users will let us know if it does. Seems worth it to nail down an API we're happy with. |
@michael-grunder I'll give it a shot then. |
@yossigo - sounds good to me. |
I've opened ticket #813 with a proposal, please let me know if this looks good to you. |
Current TLS support in
hiredis
offers two ways to trigger the OpenSSL global state initialisation:redisSecureConnection()
.SSL_library_init()
on your own (if that's not already done by another component) and then useredisInitiateSSL()
to set up Redis connections.In order to avoid unwanted dependencies, it would be very convenient to hide the explicit call to
SSL_library_init()
in a publichiredis
symbol. In other words, wrap the following logic + state fromssl.c
in a function and expose it viahiredis.h
.I'm not very familiar with
hiredis
internals, but if you agree with the proposal I could try to submit a PR :)The text was updated successfully, but these errors were encountered: