Bug #107947 libssl bundled with Connector/C++ is wrongly linked
Submitted: 22 Jul 16:01 Modified: 8 Aug 22:19
Reporter: Takeo Sawada Email Updates:
Status: Closed Impact on me:
Category:Connector / C++ Severity:S3 (Non-critical)
Version:8.0.30 OS:MacOS
Assigned to: CPU Architecture:Any (both x86 and ARM)

[22 Jul 16:01] Takeo Sawada
Prebuilt Connector/C++ for Mac, distributed at https://dev.mysql.com/downloads/connector/cpp/ , depends on libssl and libcrypto, which are bundled together.
However, that bundled libssl1.1.dylib depends on libcrypto.1.1.dylib installed in /usr/local/mysql/lib , instead of the one that is bundled together in the same directory.

/usr/local/mysql/lib usually does not exist in most environment, thus the bundled libssl is unusable. Users need to prepare their own libssl somehow in order to use the connector library.

How to repeat:
Download and extract https://dev.mysql.com/get/Downloads/Connector-C++/mysql-connector-c++-8.0.29-macos12-x86-6...
Same for ARM64

% otool -L lib64/libmysqlcppconn.dylib | grep crypto
        libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)

libmysqlcppconn.dylib is good.

% otool -L libssl.1.1.dylib | grep crypto
        /usr/local/mysql/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)

libssl.dylib wrongly links to "/usr/local/mysql/lib/libcrypto.1.1.dylib". This should "libcrypto.1.1.dylib", just like what libmysqlcppconn.dylib does.

Suggested fix:
[25 Jul 9:03] MySQL Verification Team
Hello Takeo Sawada,

Thank you for the report and feedback.

[31 Jul 7:49] Takeo Sawada
This is still the case for the latest 8.0.30.
[8 Aug 22:19] Christine Cole
Posted by developer:
Fixed as of the upcoming MySQL Connector/C++ 8.0.31 release, and here's the proposed changelog entry from the documentation team:

The libcrypto library, which libssl attempted to link to, was installed
in an unexpected directory by the Connector/C++ binary distribution for
macOS. This fix ensures that both bundled libraries are installed in the
same directory.

Thank you for the bug report.