Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Databases and Redis

A new MariaDB client refuses to connect to a server without TLS (error 2026)

ErrorERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it

Short answer

From MariaDB 11.4 on, clients use TLS and verify the server certificate by default, and Connector/C turns TLS on for all non-local connections. A server with no TLS set up, such as an old 10.4 install, cannot answer. Either configure TLS on the server (the better fix) or tell the client to skip TLS for a trusted network.

  • Applies to MariaDB client 11.4 and later, MariaDB server 10.4 to 11.4, MySQL client 8.4
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask the server whether it has TLS at all. A value of DISABLED for have_ssl, or an empty Ssl_version on an existing connection, means no encryption is in use.

    SHOW GLOBAL VARIABLES LIKE 'have_ssl';
    SHOW SESSION STATUS LIKE 'Ssl_version';
  2. 2Match what you see, then jump to its fix

    1. 1have_ssl is DISABLED on the server you connect toThe server has no certificate and key configuredFix
    2. 2The server will stay without TLS for now, for example a legacy 10.4 box on a private network, and you cannot change it yetA trusted private link where you accept no encryptionFix

What does the error look like?

  • ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it
  • SQLSTATE[HY000] [2026] TLS/SSL error: SSL is required, but the server does not support it

Cause 1 of 2

The server has no certificate and key configured

1Check

A server only offers TLS when it is given ssl_cert, ssl_key and, for verification, ssl_ca. Check whether the options exist in its config.

SHOW GLOBAL VARIABLES LIKE 'ssl_%';

2Fix

Create or obtain a certificate and key, point the server at them with absolute paths, and restart it. Clients then connect over TLS; give them ssl_ca so the certificate can be verified.

# my.cnf on the server
[mysqld]
ssl_cert = /etc/mysql/ssl/server-cert.pem
ssl_key  = /etc/mysql/ssl/server-key.pem
ssl_ca   = /etc/mysql/ssl/ca.pem

# my.cnf on the client
[client-mariadb]
ssl_ca = /etc/mysql/ssl/ca.pem

3Verify

have_ssl is YES on the server, and a client session reports a TLS version.

SHOW GLOBAL VARIABLES LIKE 'have_ssl';
SHOW SESSION STATUS LIKE 'Ssl_version';

Confirmed by mariadb.com

Did this fix it?

Cause 2 of 2

A trusted private link where you accept no encryption

1Check

Decide if traffic may cross the network unencrypted. Before MariaDB 11.4 the default was to send data unencrypted; the client's new default is the change you are hitting.

mariadb --version

2Fix

Tell the client not to use TLS for this connection. Use this only on a network you trust, and treat it as a stopgap until the server has TLS.

mariadb -h 10.0.0.5 -u app -p --disable-ssl

# or in the client option file
[client-mariadb]
disable-ssl

3Verify

The connection opens. Ssl_version stays empty because no encryption is in effect.

mariadb -h 10.0.0.5 -u app -p --disable-ssl -e "SHOW SESSION STATUS LIKE 'Ssl_version'"

Confirmed by mariadb.com

Did this fix it?

How do I stop it coming back?

  • Give every server a certificate and key before its clients are upgraded to 11.4 or later.
  • Keep the CA file on every client and use ssl_ca instead of switching verification off.
  • Upgrade or retire servers that are too old to be configured with TLS.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.