A new MariaDB client refuses to connect to a server without TLS (error 2026)
ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support itShort 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.
Fix it fast
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';2Match what you see, then jump to its fix
What does the error look like?
ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support itSQLSTATE[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.pem3Verify
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
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 --version2Fix
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-ssl3Verify
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
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- ShopGoAn e-commerce aggregator with a Python scraping engine behind its catalog, past 10K Google Play downloads.
Related fixes
Databases
Installing the Airflow MySQL provider fails on pkg-config or mysqlclient
Building the mysqlclient wheel fails during the install
The Airflow MySQL provider depends on mysqlclient, which pip compiles against the MySQL C client library.
2 causes, each with a fixDatabases
A query on Aurora MySQL dies with 'table /rdsdbdata/tmp/#sql... is full'
ERROR 1114 (HY000): The table '/rdsdbdata/tmp/#sqlfd_1586_2' is full
In Aurora MySQL 3, internal temporary tables share one pool, and when that pool and the memory-mapped overflow file are used up, a reader instance ends the query with error 1114.
3 causes, each with a fixDatabases
Azure Database for MySQL refuses a connection that does not use SSL
ERROR 3159 (HY000): Connections using insecure transport are prohibited while --require_secure_transport=ON.
Azure Database for MySQL Flexible Server requires encrypted connections by default (require_secure_transport = ON, TLS 1.2).
4 causes, each with a fixDatabases
Compiling a C or C++ program that includes mysql.h fails
undefined reference to `mysql_init'
The compiler only finds mysql.h when the MySQL client development files are installed and their folder is on the include path.
3 causes, each with a fixDatabases
DBeaver fails to resolve Maven dependencies when downloading a database driver
A driver library does not download automatically
DBeaver downloads driver jars from a Maven repository.
3 causes, each with a fixDatabases
DBeaver cannot verify the MySQL server certificate
unable to find valid certification path to requested target
DBeaver's MySQL driver is checking the server certificate and Java does not trust the CA that signed it.
2 causes, each with a fix