Bug #75623 MySQL Fails to Compile against OpenSSL 1.0.2
Submitted: 25 Jan 2015 11:46 Modified: 26 Jan 2015 10:48
Reporter: Dominyk Tiller Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.6.22 & Prior OS:MacOS
Assigned to: CPU Architecture:Any
Tags: openssl

[25 Jan 2015 11:46] Dominyk Tiller
Description:
The latest OpenSSL release, the 1.0.2 branch, added a little whitespace to the versioning header, which in turn has broken MySQL's compile.

------------------------------------------------
-- OPENSSL_INCLUDE_DIR = /usr/local/opt/openssl/include
-- OPENSSL_LIBRARY = /usr/local/opt/openssl/lib/libssl.dylib
-- CRYPTO_LIBRARY = /usr/local/opt/openssl/lib/libcrypto.dylib
-- OPENSSL_MAJOR_VERSION =
-- Looking for SHA512_DIGEST_LENGTH
-- Looking for SHA512_DIGEST_LENGTH - found
CMake Error at cmake/ssl.cmake:234 (MESSAGE):
  Cannot find appropriate system libraries for SSL.  Use WITH_SSL=bundled to
  enable SSL support
Call Stack (most recent call first):
  CMakeLists.txt:404 (MYSQL_CHECK_SSL)
----------------------------------------------------

Mike McQuaid of Homebrew has drawn up a short patch to fix the compile issue, which you can find here: https://github.com/mysql/mysql-server/pull/3 or attached at the bottom of this bug report.

Thanks!

How to repeat:
1) Compile OpenSSL 1.0.2
2) Build MySQL against it.

Suggested fix:
From de50476a36cdc18a832146d356e1aec3868fd1d1 Mon Sep 17 00:00:00 2001
From: Mike McQuaid <mike@mikemcquaid.com>
Date: Sun, 25 Jan 2015 11:32:42 +0000
Subject: [PATCH] ssl.cmake: fix version regex for OpenSSL 1.0.2.

OpenSSL 1.0.2 has whitespace between the # and define so make the regex more
liberal to match it accordingly.
---
 cmake/ssl.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
index 42251a8..66eecd7 100644
--- a/cmake/ssl.cmake
+++ b/cmake/ssl.cmake
@@ -166,7 +166,7 @@ MACRO (MYSQL_CHECK_SSL)
     # Encoded as MNNFFPPS: major minor fix patch status
     FILE(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h"
       OPENSSL_VERSION_NUMBER
-      REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*"
+      REGEX "^#[\t ]+define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*"
     )
     STRING(REGEX REPLACE
       "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1"
-- 
2.1.4
[25 Jan 2015 11:47] Dominyk Tiller
Affects versions prior to the latest release as well, not just the latest stable release, alas.
[26 Jan 2015 10:48] MySQL Verification Team
Hello Dominyk Tiller,

Thank you for the report.
This is most likely duplicate of Bug #75622. 

Thanks,
Umesh