Bug #114784 MySQL fails to build against OpenSSL < 1.1.1 with WITHOUT_SERVER=ON
Submitted: 25 Apr 2024 12:27 Modified: 25 Apr 2024 12:51
Reporter: Nikita Radchenko Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S3 (Non-critical)
Version:8.0 OS:Ubuntu (16.04)
Assigned to: CPU Architecture:x86

[25 Apr 2024 12:27] Nikita Radchenko
Description:
"Configuring SSL Library Support" documentation page for 8.0 states that building MySQL requires at least OpenSSL version 1.0.1. However, building fails when OpenSSL 1.0.2 is installed, and WITHOUT_SERVER=ON option is set.

The error is:

/build/tmp-build/mysql-8.0.35/sql-common/client.cc: In function 'void* mysql_get_ssl_session_data(MYSQL*, unsigned int, unsigned int*)':
/build/tmp-build/mysql-8.0.35/sql-common/client.cc:3530:17: error: 'SSL_SESSION_is_resumable' was not declared in this scope
 3530 |   if (!sess || !SSL_SESSION_is_resumable(sess.get())) {
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
/build/tmp-build/mysql-8.0.35/sql-common/client.cc: In function 'SSL_SESSION* ssl_session_deserialize_from_data_ptr(MYSQL*, char*)':
/build/tmp-build/mysql-8.0.35/sql-common/client.cc:3575:17: error: 'SSL_SESSION_is_resumable' was not declared in this scope
 3575 |     if (ret && !SSL_SESSION_is_resumable(ret)) {
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~

With WITHOUT_SERVER=OFF (which is the default), the build succeeds.

How to repeat:
1. Prepare a clean environment based on a distro with OpenSSL pre-1.1.1 (e.g. Ubuntu Xenial)
2. Prepare MySQL sources
3. cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITHOUT_SERVER=ON -DWITH_SSL=system -DWITH_ZLIB=bundled -DWITH_LIBWRAP=OFF -DWITH_AUTHENTICATION_FIDO=OFF -DWITH_AUTHENTICATION_KERBEROS=OFF -DWITH_AUTHENTICATION_LDAP=OFF
4. make

Suggested fix:
In source file sql-common/client.cc, move 'SSL_SESSION_is_resumable' stub definition out of '#ifdef HAVE_PSI_INTERFACE' block.
[25 Apr 2024 12:51] MySQL Verification Team
Hi Mr. Radchenko,

This is the error in our documentation.

It shall be updated to reflect the correct version.

Verified as a documentation bug.
[25 Apr 2024 14:15] MySQL Verification Team
Hi,

We are changing the category to the correct one.

This is now a verified bug report in our client library.