summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Soderberg <joakim.soderberg@gmail.com>2014-09-24 13:46:09 +0200
committerJoakim Soderberg <joakim.soderberg@gmail.com>2014-09-24 13:46:09 +0200
commit5c7282f7a5b2f0cd10a7891d61cec07ab2fa2a8e (patch)
tree856cce4ddb8eb2fe663f2cfc477d619fb09cd1f4
parent89c1a3b7fe91a5132f854be9f672b0daa368cf7d (diff)
downloadlibevent-5c7282f7a5b2f0cd10a7891d61cec07ab2fa2a8e.tar.gz
Fix compilation for older OpenSSL versions.
For instance OpenSSL 0.9.7 does not have SSL_set_tlsext_host_name. Also add the missing EVENT__DISABLE_SAMPLES CMake option.
-rw-r--r--CMakeLists.txt1
-rw-r--r--sample/https-client.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 124dc86a..1d38e3fd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,6 +48,7 @@ option(EVENT__DISABLE_OPENSSL "Define if libevent should build without support f
option(EVENT__DISABLE_BENCHMARK "Defines if libevent should build without the benchmark exectuables" OFF)
option(EVENT__DISABLE_TESTS "If tests should be compiled or not" OFF)
option(EVENT__DISABLE_REGRESS "Disable the regress tests" OFF)
+option(EVENT__DISABLE_SAMPLES "Disable sample files" OFF)
option(EVENT__FORCE_KQUEUE_CHECK "When crosscompiling forces running a test program that verifies that Kqueue works with pipes. Note that this requires you to manually run the test program on the the cross compilation target to verify that it works. See cmake documentation for try_run for more details" OFF)
option(EVENT__COVERAGE "Enable running gcov to get a test coverage report (only works with GCC/CLang). Make sure to enable -DCMAKE_BUILD_TYPE=Debug as well." OFF)
# TODO: Add --disable-largefile omit support for large files
diff --git a/sample/https-client.c b/sample/https-client.c
index b5f0b1ae..b9bbb4ca 100644
--- a/sample/https-client.c
+++ b/sample/https-client.c
@@ -346,8 +346,10 @@ main(int argc, char **argv)
die_openssl("SSL_new()");
}
+ #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
// Set hostname for SNI extension
SSL_set_tlsext_host_name(ssl, host);
+ #endif
if (strcasecmp(scheme, "http") == 0) {
bev = bufferevent_socket_new(base, -1, BEV_OPT_CLOSE_ON_FREE);