From d7d8c081aac70fd63bc9d4815588ec861749b08e Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Thu, 6 Apr 2017 15:46:37 +0200 Subject: [PATCH] Subject: ssl: fix OpenSSL client method detection --- CMakeLists.txt | 6 ++---- lib/ssl-client.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index abc50524..6e905058 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -474,10 +474,6 @@ CHECK_FUNCTION_EXISTS(_snprintf LWS_HAVE__SNPRINTF) CHECK_FUNCTION_EXISTS(_vsnprintf LWS_HAVE__VSNPRINTF) CHECK_FUNCTION_EXISTS(getloadavg LWS_HAVE_GETLOADAVG) -CHECK_FUNCTION_EXISTS(TLS_client_method LWS_HAVE_TLS_CLIENT_METHOD) -CHECK_FUNCTION_EXISTS(TLSv1_2_client_method LWS_HAVE_TLSV1_2_CLIENT_METHOD) - - if (NOT LWS_HAVE_GETIFADDRS) if (LWS_WITHOUT_BUILTIN_GETIFADDRS) message(FATAL_ERROR "No getifaddrs was found on the system. Turn off the LWS_WITHOUT_BUILTIN_GETIFADDRS compile option to use the supplied BSD version.") @@ -1032,6 +1028,8 @@ set (temp ${CMAKE_REQUIRED_LIBRARIES}) set(CMAKE_REQUIRED_LIBRARIES ${LIB_LIST}) CHECK_FUNCTION_EXISTS(SSL_CTX_set1_param LWS_HAVE_SSL_CTX_set1_param) CHECK_FUNCTION_EXISTS(X509_VERIFY_PARAM_set1_host LWS_HAVE_X509_VERIFY_PARAM_set1_host) +CHECK_FUNCTION_EXISTS(TLS_client_method LWS_HAVE_TLS_CLIENT_METHOD) +CHECK_FUNCTION_EXISTS(TLSv1_2_client_method LWS_HAVE_TLSV1_2_CLIENT_METHOD) set(CMAKE_REQUIRED_LIBRARIES ${temp}) # Generate the lws_config.h that includes all the public compilation settings. configure_file( diff --git a/lib/ssl-client.c b/lib/ssl-client.c index 89fc57e8..45c9fb77 100644 --- a/lib/ssl-client.c +++ b/lib/ssl-client.c @@ -472,11 +472,10 @@ int lws_context_init_client_ssl(struct lws_context_creation_info *info, /* choose the most recent spin of the api */ #if defined(LWS_HAVE_TLS_CLIENT_METHOD) method = (SSL_METHOD *)TLS_client_method(); -#if defined(LWS_HAVE_TLSV1_2_CLIENT_METHOD) +#elif defined(LWS_HAVE_TLSV1_2_CLIENT_METHOD) method = (SSL_METHOD *)TLSv1_2_client_method(); #else method = (SSL_METHOD *)SSLv23_client_method(); -#endif #endif if (!method) { error = ERR_get_error(); -- 2.34.1