Bug #85865 Fail to build on Debian Stretch with -DWITH_SSL=system
Submitted: 8 Apr 2017 13:29 Modified: 8 Apr 2017 16:16
Reporter: Sergei Glushchenko Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.7.x OS:Debian (9)
Assigned to: CPU Architecture:Any
Tags: openssl

[8 Apr 2017 13:29] Sergei Glushchenko
Description:
Many types became opaque in OpenSSL 1.1 and no longer can be allocated on stack / their member properties no longer can be accessed.

Build fails with error:

[  7%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_aes_openssl.cc.o
/root/mysql-server/mysys_ssl/my_aes_openssl.cc: In function 'int my_aes_encrypt(const unsigned char*, uint32, unsigned char*, const unsigned char*, uint32, my_aes_opmode, const unsigned char*, bool)':
/root/mysql-server/mysys_ssl/my_aes_openssl.cc:125:18: error: aggregate 'EVP_CIPHER_CTX ctx' has incomplete type and cannot be defined
   EVP_CIPHER_CTX ctx;
                  ^~~
/root/mysql-server/mysys_ssl/my_aes_openssl.cc: In function 'int my_aes_decrypt(const unsigned char*, uint32, unsigned char*, const unsigned char*, uint32, my_aes_opmode, const unsigned char*, bool)':
/root/mysql-server/mysys_ssl/my_aes_openssl.cc:162:18: error: aggregate 'EVP_CIPHER_CTX ctx' has incomplete type and cannot be defined
   EVP_CIPHER_CTX ctx;
                  ^~~
mysys_ssl/CMakeFiles/mysys_ssl.dir/build.make:302: recipe for target 'mysys_ssl/CMakeFiles/mysys_ssl.dir/my_aes_openssl.cc.o' failed
make[2]: *** [mysys_ssl/CMakeFiles/mysys_ssl.dir/my_aes_openssl.cc.o] Error 1
CMakeFiles/Makefile2:5309: recipe for target 'mysys_ssl/CMakeFiles/mysys_ssl.dir/all' failed
make[1]: *** [mysys_ssl/CMakeFiles/mysys_ssl.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

How to repeat:
git clone https://github.com/mysql/mysql-server.git
git checkout 5.7
mkdir bld
cd bld
cmake .. -DWITH_SSL=system -DDOWNLOAD_BOOST=1 -DWITH_BOOST=~/boost

Suggested fix:
Update SSL-related code
[8 Apr 2017 16:16] Terje Røsten
Hi, thanks for your report.

Support for OpenSSL 1.1 in MySQL is tracked in other bug report:
 https://bugs.mysql.com/bug.php?id=83814