Skip to content

Commit 4282bac

Browse files
authored
Enable OpenSSL to load a configuration file during initialization (#168)
1 parent 820605c commit 4282bac

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

memtier_benchmark.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include <sys/resource.h>
3535

3636
#ifdef USE_TLS
37+
#include <openssl/crypto.h>
38+
#include <openssl/conf.h>
3739
#include <openssl/ssl.h>
3840
#include <openssl/err.h>
3941
#include <openssl/rand.h>
@@ -1216,6 +1218,14 @@ static void init_openssl(void)
12161218
exit(1);
12171219
}
12181220

1221+
//Enable memtier benchmark to load an OpenSSL config file.
1222+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
1223+
OPENSSL_config(NULL);
1224+
#else
1225+
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
1226+
#endif
1227+
1228+
12191229
init_openssl_threads();
12201230
}
12211231

0 commit comments

Comments
 (0)