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

Do not explicitly initialize openSSL in newer versions #1283

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

crrodriguez
Copy link
Contributor

@crrodriguez crrodriguez commented Feb 4, 2025

Recentish openSSL versions have implicit initialization and is better to let it be, unless you have something special to do.

@michael-grunder
Copy link
Collaborator

Only read a bit about the deprecation in newer versions, but I'm not sure why we would want this controled by HIREDIS_USE_CRYPTO_LOCKS.

Wouldn't it be more idiomatic to do something like:

// Assuming this is the correct version
#if OPENSSL_VERSION_NUMBER < 0x10100000L
    SSL_library_init();
#endif

@crrodriguez
Copy link
Contributor Author

I know it looks odd.. but if you need the crypto locks you need initialization..else you don't. It was the shortest possible change.
It can be made version specific if you think it is better.

@michael-grunder
Copy link
Collaborator

Oh I see now, you're totally correct. 

I assumed HIREDIS_USE_CRYPTO_LOCKS was user toggled, but it's simply this:

#if OPENSSL_VERSION_NUMBER < OPENSSL_1_1_0
#define HIREDIS_USE_CRYPTO_LOCKS
#endif

So this change is correct.

@michael-grunder michael-grunder merged commit ab8c75e into redis:master Feb 5, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants