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

Fixed build for tls v1.3 on openssl v1.0.2. Added CI check #253

Merged
merged 4 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,27 @@ jobs:
bash <(curl -s https://codecov.io/bash) -f memtier_benchmark-*-coverage.info || echo "Codecov did not collect coverage reports"

build-macos:
strategy:
matrix:
openssl: ["1.1", "3.0"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: brew install autoconf automake libtool libevent pkg-config openssl@${{ matrix.openssl }}
- name: Build
run: autoreconf -ivf && PKG_CONFIG_PATH=/usr/local/opt/openssl@${{ matrix.openssl }}/lib/pkgconfig ./configure && make

build-macos-openssl-1-0-2:
strategy:
matrix:
platform: [macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: brew install autoconf automake libtool libevent pkg-config openssl@1.1
run: brew install autoconf automake libtool libevent pkg-config
- name: Install openssl v1.0.2
run: brew install rbenv/tap/openssl@1.0
- name: Build
run: autoreconf -ivf && PKG_CONFIG_PATH=/usr/local/opt/openssl@1.1/lib/pkgconfig ./configure && make
run: autoreconf -ivf && PKG_CONFIG_PATH=/usr/local/opt/openssl@1.0/lib/pkgconfig ./configure && make
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ On Ubuntu/Debian distributions, simply install all prerequisites as follows:
To build natively on macOS, use Homebrew to install the required dependencies:

```
$ brew install autoconf automake libtool libevent pkg-config openssl@1.1
$ brew install autoconf automake libtool libevent pkg-config openssl@3.0
```

When running `./configure`, if it fails to find libssl it may be necessary to
tweak the `PKG_CONFIG_PATH` environment variable:

```
PKG_CONFIG_PATH=/usr/local/opt/openssl@1.1/lib/pkgconfig ./configure
PKG_CONFIG_PATH=/usr/local/opt/openssl@3.0/lib/pkgconfig ./configure
```

### Building and installing
Expand Down
3 changes: 3 additions & 0 deletions memtier_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1392,8 +1392,11 @@ int main(int argc, char *argv[])
SSL_CTX_set_options(cfg.openssl_ctx, SSL_OP_NO_TLSv1_1);
if (!(cfg.tls_protocols & REDIS_TLS_PROTO_TLSv1_2))
SSL_CTX_set_options(cfg.openssl_ctx, SSL_OP_NO_TLSv1_2);
// TLS 1.3 is only available as from version 1.1.1.
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
if (!(cfg.tls_protocols & REDIS_TLS_PROTO_TLSv1_3))
SSL_CTX_set_options(cfg.openssl_ctx, SSL_OP_NO_TLSv1_3);
#endif

if (cfg.tls_cert) {
if (!SSL_CTX_use_certificate_chain_file(cfg.openssl_ctx, cfg.tls_cert)) {
Expand Down
Loading