// MySQL error reference

MySQL error 2026: SSL connection error

The TLS handshake between client and MySQL server failed: a certificate the client won't trust, mismatched TLS versions, or SSL required but disabled.

Error number
2026
Name
CR_SSL_CONNECTION_ERROR
Category
Connection and client
Error message
SSL connection error: %s

What it means

The client and server couldn't set up an encrypted connection. The text after SSL connection error: is the TLS library's reason, for example a certificate verification failure or no common protocol version, and is the part to read.

Common causes

  • The client verifies the server certificate (--ssl-mode=VERIFY_CA or VERIFY_IDENTITY) and the certificate is self-signed or the host name doesn't match.
  • The client is configured to require TLS and the server has it disabled.
  • An old client or server only supports TLS versions the other side has turned off.
  • Wrong paths or permissions for the CA, certificate or key files.

How to fix it

  1. Check what the server offers.

    SHOW VARIABLES LIKE '%ssl%';
    SHOW VARIABLES LIKE 'tls_version';
  2. Give the client the CA certificate that signed the server's certificate, for example mysql --ssl-mode=VERIFY_CA --ssl-ca=ca.pem -h db.example.com -u app -p.

  3. If both sides are old, upgrade the client library rather than re-enabling old TLS versions on the server.

Related errors

More connection and client errors

The code and message text are from the MySQL 8.4 Error Message Reference. Browse the full MySQL error list or search every database error.

// fewer errors, faster fixes

Work on MySQL in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for MySQL and the other databases you use.