Skip to content

Commit c2ed7cb

Browse files
authored
Merge pull request #90 from yossigo/tls
TLS Support
2 parents 050f29c + 6637a4d commit c2ed7cb

File tree

8 files changed

+348
-214
lines changed

8 files changed

+348
-214
lines changed

Makefile.am

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ bin_PROGRAMS = memtier_benchmark
2323
completionsdir=$(BASH_COMPLETION_DIR)
2424
completions_DATA=bash-completion/memtier_benchmark
2525

26-
memtier_benchmark_CPPFLAGS = $(LIBEVENT_CFLAGS)
26+
memtier_benchmark_CPPFLAGS = \
27+
$(LIBEVENT_CFLAGS) \
28+
$(LIBEVENT_OPENSSL_CFLAGS) \
29+
$(LIBCRYPTO_CFLAGS) \
30+
$(LIBSSL_CFLAGS)
2731
memtier_benchmark_SOURCES = \
2832
memtier_benchmark.cpp memtier_benchmark.h \
2933
client.cpp client.h \
@@ -37,7 +41,11 @@ memtier_benchmark_SOURCES = \
3741
item.cpp item.h \
3842
file_io.cpp file_io.h \
3943
config_types.cpp config_types.h
40-
memtier_benchmark_LDADD = $(LIBEVENT_LIBS)
44+
memtier_benchmark_LDADD = \
45+
$(LIBEVENT_LIBS) \
46+
$(LIBEVENT_OPENSSL_LIBS) \
47+
$(LIBCRYPTO_LIBS) \
48+
$(LIBSSL_LIBS)
4149

4250
dist_man1_MANS = memtier_benchmark.1
4351

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ memtier_benchmark is a command line utility developed by Redis Labs (formerly Ga
1010
* Random and sequential key name pattern policies
1111
* Random or ranged key expiration
1212
* Redis cluster
13+
* TLS support
1314
* ...and much more
1415

1516
Read more at:
@@ -25,6 +26,7 @@ The following libraries are required for building:
2526

2627
* libevent 2.0.10 or newer.
2728
* libpcre 8.x.
29+
* OpenSSL (unless TLS support is disabled by `./configure --disable-tls`).
2830

2931
The following tools are required
3032
* autoconf
@@ -70,7 +72,7 @@ Then proceed to follow the build instructions below.
7072
On Ubuntu/Debian distributions, simply install all prerequisites as follows:
7173

7274
```
73-
# apt-get install build-essential autoconf automake libpcre3-dev libevent-dev pkg-config zlib1g-dev
75+
# apt-get install build-essential autoconf automake libpcre3-dev libevent-dev pkg-config zlib1g-dev libssl-dev
7476
```
7577

7678
#### macOS

configure.ac

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ AC_INIT(memtier_benchmark,1.2.17,[email protected])
2020
AC_CONFIG_SRCDIR([memtier_benchmark.cpp])
2121
AC_CONFIG_HEADER([config.h])
2222
AM_INIT_AUTOMAKE
23+
AM_SILENT_RULES([yes])
2324
LT_INIT
2425

2526
CXXFLAGS="-O2 -g -Wall"
@@ -45,6 +46,25 @@ AC_FUNC_MALLOC
4546
AC_FUNC_MEMCMP
4647
AC_CHECK_FUNCS([gettimeofday memchr memset socket strerror random_r drand48])
4748

49+
# TLS support is optional.
50+
AC_ARG_ENABLE([tls],
51+
[AS_HELP_STRING([--disable-tls],
52+
[Disable TLS/SSL support])])
53+
AS_IF([test "x$enable_tls" != "xno"], [
54+
AC_DEFINE([USE_TLS],
55+
[1],
56+
[define to enable TLS/SSL support])
57+
PKG_CHECK_MODULES([LIBEVENT_OPENSSL],
58+
[libevent_openssl >= 2.0.10],
59+
AC_SUBST(LIBEVENT_OPENSSL_CFLAGS) AC_SUBST(LIBEVENT_OPENSSL_LIBS))
60+
PKG_CHECK_MODULES([LIBSSL],
61+
[libssl],
62+
AC_SUBST(LIBSSL_CFLAGS) AC_SUBST(LIBSSL_LIBS))
63+
PKG_CHECK_MODULES([LIBCRYPTO],
64+
[libcrypto],
65+
AC_SUBST(LIBCRYPTO_CFLAGS) AC_SUBST(LIBCRYPTO_LIBS))
66+
], [])
67+
4868
# clock_gettime requires -lrt on old glibc only.
4969
AC_SEARCH_LIBS([clock_gettime], [rt], , AC_MSG_ERROR([rt is required libevent.]))
5070

0 commit comments

Comments
 (0)