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

Move SSL support to own library #80

Merged
merged 9 commits into from
Apr 6, 2022
Merged

Move SSL support to own library #80

merged 9 commits into from
Apr 6, 2022

Conversation

bjosv
Copy link
Collaborator

@bjosv bjosv commented Apr 5, 2022

This PR moves the SSL support functionality to its own library, which a user can link to only when SSL support is wanted.
This follows how hiredis is structured with its libhiredis.a/so and libhiredis_ssl.a/so.

Previously hiredis_cluster required users to build the library with or without SSL support, and were required to provide the SSL_SUPPORT define to enable the SSL configuration API when building its project.
Just linking to the new library instead is hopefully easier.

This also includes some CMake fixups by enabling transitive dependencies on targets.

This enables us to put the SSL code in a separate library,
like its done in hiredis. A user will be able to link to the new
library when SSL is wanted, and there is no longer the need of
having `SSL_SUPPORT` defined.
The tagged versions of hiredis does not include a required
packaging correction. This correction is needed to be able to
import hiredis CMake package.
A new target and package is created in CMake to build
the library `hiredis_cluster_ssl`
Use the new `hiredis_library_ssl` when linking the test binaries,
but only when building with SSL/TLS enabled.

Since CMake supports transitive dependencies the `hiredis_cluster` library
will make sure `hiredis` is include when linking, thus removing the
explicit linkage in CMake.
Includes some cleanups and the use of CMAKE_PREFIX_PATH
to remove some CMake configs.
@bjosv bjosv requested a review from zuiderkwast April 5, 2022 14:04
CMakeLists.txt Outdated Show resolved Hide resolved
ssl.c Outdated Show resolved Hide resolved
Add the missing hiredis targets if needed. This was corrected
in hiredis via: redis/hiredis#1005

Revert changes for using newer hiredis in build and examples.
@bjosv bjosv merged commit 7c39940 into master Apr 6, 2022
@bjosv bjosv deleted the separate-ssl-lib branch April 6, 2022 15:10
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.

2 participants