From 4f94810a75ba89936c0b67ace13ff0e171f3649e Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 16 Sep 2018 19:13:05 +0800 Subject: [PATCH 1/2] Fix build with LibreSSL This check is useless. If the library depends on specific features of SSL, it must check for those. Checking for version is not reliable and breaks LibreSSL compatibility. --- cdk/cmake/ssl.cmake | 6 +----- cdk/foundation/connection_openssl.cc | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cdk/cmake/ssl.cmake b/cdk/cmake/ssl.cmake index 494f0fe..1e7adca 100644 --- a/cdk/cmake/ssl.cmake +++ b/cdk/cmake/ssl.cmake @@ -251,11 +251,7 @@ function(MYSQL_CHECK_SSL) return() endif() - if(NOT OPENSSL_VERSION_MAJOR EQUAL 1) - message(SEND_ERROR "OpenSSL version 1.x is required but version ${OPENSSL_VERSION} was found") - else() - message(STATUS "Using OpenSSL version: ${OPENSSL_VERSION}") - endif() + message(STATUS "Using OpenSSL version: ${OPENSSL_VERSION}") # # We assume that FindOpenSSL finds 2 libraries in this order. diff --git a/cdk/foundation/connection_openssl.cc b/cdk/foundation/connection_openssl.cc index f7fe28c..200d710 100644 --- a/cdk/foundation/connection_openssl.cc +++ b/cdk/foundation/connection_openssl.cc @@ -188,7 +188,7 @@ static void throw_ssl_error(SSL* tls, int err) case SSL_ERROR_WANT_CONNECT: case SSL_ERROR_WANT_ACCEPT: case SSL_ERROR_WANT_X509_LOOKUP: -# if OPENSSL_VERSION_NUMBER >= 0x10100000L +# if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) case SSL_ERROR_WANT_ASYNC: case SSL_ERROR_WANT_ASYNC_JOB: # endif -- 2.19.0