TLS and Cryptography Libraries Used by MariaDB

Explains how MariaDB links to cryptography libraries (OpenSSL, wolfSSL, GnuTLS, Schannel) either statically or dynamically, and how to verify the active library and version.

When MariaDB Server is compiled with TLS and cryptography support, it is usually either statically linked with MariaDB's bundled TLS and cryptography library or dynamically linked with the system's OpenSSLarrow-up-right library. MariaDB's bundled TLS library is either wolfSSLarrow-up-right or yaSSLarrow-up-right, depending on the server version.

When a MariaDB client or client library is compiled with TLS and cryptography support, it is usually either statically linked with MariaDB's bundled TLS and cryptography library or dynamically linked with the system's TLS and cryptography library, which might be OpenSSLarrow-up-right, GnuTLSarrow-up-right, or Schannelarrow-up-right.

Checking Dynamically vs. Statically Linked

Dynamically linking MariaDB to the system's TLS and cryptography library can often be beneficial, since this allows you to fix bugs in the system's TLS and cryptography library independently of MariaDB. For example, when information on the Heartbleed Bugarrow-up-right in OpenSSLarrow-up-right was released in 2014, the bug could be mitigated by simply updating your system to use a fixed version of the OpenSSLarrow-up-right library, and then restarting the MariaDB Server.

You can verify that mysqld is in fact dynamically linked to the OpenSSLarrow-up-right shared library on your system by using the lddarrow-up-right command:

$ ldd $(which mysqld) | grep -E '(libssl|libcrypto)'
        libssl.so.10 => /lib64/libssl.so.10 (0x00007f8736386000)
        libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f8735f25000)

If the command does not return any results, then either your mysqld is statically linked to the TLS and cryptography library on your system or your mysqld is not built with TLS and cryptography support at all.

Checking If the Server Uses OpenSSL

If you aren't sure whether your server is linked with OpenSSLarrow-up-right or the bundled TLS library, then you can check the value of the have_openssl system variable. For example:

SHOW GLOBAL VARIABLES LIKE 'have_openssl';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_openssl  | YES   |
+---------------+-------+

Checking the Server's OpenSSL Version

If you want to see what version of OpenSSLarrow-up-right your server is using, then you can check the value of the version_ssl_library system variable. For example:

Note that the version returned by this system variable does not always necessarily correspond to the exact version of the OpenSSLarrow-up-right package installed on the system. OpenSSLarrow-up-right shared libraries tend to contain interfaces for multiple versions at once to allow for backward compatibility. Therefore, if the OpenSSLarrow-up-right package installed on the system is newer than the OpenSSLarrow-up-right version that the MariaDB Server binary was built with, then the MariaDB Server binary might use one of the interfaces for an older version. See MDEV-15848arrow-up-right for more information. For example:

FIPS Certification

Federal Information Processing Standards (FIPS)arrow-up-right are standards published by the U.S. federal government that are used to establish requirements for various aspects of computer systems. FIPS 140-2arrow-up-right is a set of standards for security requirements for cryptographic modules.

This standard is relevant when discussing the TLS and cryptography libraries used by MariaDB. Some of these libraries have been certified to meet the standards set by FIPS 140-2.

FIPS Certification by OpenSSL

The OpenSSLarrow-up-right library has a special FIPS mode that has been certified to meet the FIPS 140-2 standard. In FIPS mode, only algorithms and key sizes that meet the FIPS 140-2 standard are enabled by the library.

MariaDB does not yet support enabling FIPS mode within the database server. See MDEV-20260arrow-up-right for more information. Therefore, if you would like to use OpenSSL's FIPS mode with MariaDB, then you would either need to enable FIPS mode at the kernel level or enable it via the OpenSSL configuration file, system-wide or only for the MariaDB process.. See the following resources for more information on how to do that:

FIPS Certification by wolfSSL

The standard version of the wolfSSLarrow-up-right library has not been certified to meet the FIPS 140-2 standard, but a special "FIPS-ready"arrow-up-right version has been certified. Unfortunately, the "FIPS-ready" version of wolfSSL uses a license that is incompatible with MariaDB's license, so it cannot be used with MariaDB.

FIPS Certification by yaSSL

The yaSSLarrow-up-right library has not been certified to meet the FIPS 140-2 standard.

Libraries Used by Each Platform and Package

MariaDB Server

MariaDB Server on Windows

MariaDB Server is statically linked with the bundled wolfSSLarrow-up-right library in MSI and ZIP packages on Windows.

MariaDB Server on Linux

MariaDB Server in Binary Tarballs

MariaDB Server is statically linked with the bundled wolfSSLarrow-up-right library in binary tarballs on Linux.

MariaDB Server in DEB Packages

MariaDB Server is dynamically linked with the system's OpenSSLarrow-up-right library in .debarrow-up-right packages.

See Differences in MariaDB in Debian (and Ubuntu) for more information.

MariaDB Server in RPM Packages

MariaDB Server is dynamically linked with the system's OpenSSLarrow-up-right library in .rpmarrow-up-right packages.

MariaDB Clients and Utilities

MariaDB Connector/C has been included with MariaDB Server, and the bundled and the clients and utilities are linked with it. On some platforms, MariaDB Connector/C and these clients and utilitiesarrow-up-right may use a different TLS library than the one used by MariaDB Server and libmysqlclientarrow-up-right.

MariaDB Clients and Utilities on Windows

MariaDB's clients and utilitiesarrow-up-right and MariaDB Connector/C are dynamically linked with the system's Schannelarrow-up-right libraries in MSI and ZIP packages on Windows. libmysqlclientarrow-up-right is still statically linked with the bundled wolfSSLarrow-up-right library. <>

MariaDB Clients and Utilities on Linux

MariaDB Clients and Utilities in Binary Tarballs

MariaDB's clients and utilitiesarrow-up-right and MariaDB Connector/C are statically linked with the GnuTLSarrow-up-right library in binary tarballs on Linux. libmysqlclientarrow-up-right is still statically linked with the bundled wolfSSLarrow-up-right library. <>

MariaDB Clients and Utilities in DEB Packages

MariaDB's clients and utilitiesarrow-up-right, libmysqlclientarrow-up-right, and MariaDB Connector/C are dynamically linked with the system's OpenSSLarrow-up-right library in .debarrow-up-right packages.

See Differences in MariaDB in Debian (and Ubuntu) for more information.

MariaDB Clients and Utilities in RPM Packages

MariaDB's clients and utilitiesarrow-up-right, libmysqlclientarrow-up-right, and MariaDB Connector/C are dynamically linked with the system's OpenSSLarrow-up-right library in .rpmarrow-up-right packages.

Updating Dynamically Linked OpenSSL Libraries on Linux

When the MariaDB Server or clients and utilities are dynamically linked to the system's OpenSSLarrow-up-right library, it makes it very easy to update the libraries. The information below will show how to update these libraries for each platform.

Updating Dynamically Linked OpenSSL Libraries with yum/dnf

On RHEL, CentOS, Fedora, and other similar Linux distributions, it is highly recommended to update the libraries using yumarrow-up-right or dnfarrow-up-right. Starting with RHEL 8 and Fedora 22, yum has been replaced by dnf, which is the next major version of yum. However, yum commands still work on many systems that use dnf. For example:

Update the package by executing the following command:

And then restart MariaDB server and any clients or applications that use the library.

Updating Dynamically Linked OpenSSL Libraries with apt-get

On Debian, Ubuntu, and other similar Linux distributions, it is highly recommended to recommended to update the libraries using apt-getarrow-up-right. For example:

First update the package cache by executing the following command:

And then update the package by executing the following command:

And then restartarrow-up-right MariaDB server and any clients or applications that use the library.

Updating Dynamically Linked OpenSSL Libraries with zypper

On SLES, OpenSUSE, and other similar Linux distributions, it is highly recommended to recommended to update the libraries using zypperarrow-up-right. For example:

Update the package by executing the following command:

And then restartarrow-up-right MariaDB server and any clients or applications that use the library.

This page is licensed: CC BY-SA / Gnu FDL

spinner

Last updated

Was this helpful?