Skip to main content

Fixed: "[Warning] [MY-015011] Failed to validate certificate because invalid CA certificate" in MySQL

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

MySQL started, said TLS was fine, and two lines above that, warned me Failed to validate certificate … because invalid CA certificate. It carries on regardless, so the warning is easy to miss, and clients that check the certificate will be the ones to fail.

What I Was Doing​

I had made my own CA and server certificate with openssl, and mounted them into the MySQL 9.7 Docker image. To keep the commands independent of each computer's settings, I ran them with an empty OpenSSL configuration:

Terminal
export OPENSSL_CONF=/dev/null
openssl req -x509 -newkey rsa:2048 -nodes -days 3650 -keyout ca-key.pem -out ca.pem -subj "/CN=Inventory Demo CA"

Then:

Terminal
docker compose logs mysql

What I Expected​

Just the line saying TLS is configured.

What I Got​

Output
2026-11-06T05:10:06.528791Z 0 [Warning] [MY-015011] [Server] Failed to validate certificate /etc/mysql/certs/server-cert.pem because invalid CA certificate
2026-11-06T05:10:06.528922Z 0 [Warning] [MY-015010] [Server] Server certificate /etc/mysql/certs/server-cert.pem verification has failed. Check logs for more details
2026-11-06T05:10:06.530453Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.

MySQL's log showing MY-015011: Failed to validate certificate because invalid CA certificate, and MY-013602 saying Channel mysql_main is configured to support TLS.

What I Checked​

The CA file:

Terminal
openssl x509 -in ca.pem -noout -ext basicConstraints
Output
No extensions in certificate

A real CA says CA:TRUE here. openssl verify agreed with MySQL: error 79 at 1 depth lookup: invalid CA certificate.

Where it usually comes from. openssl req -x509 adds CA:TRUE from the defaults in openssl.cnf. With an empty configuration, there are no defaults, so there's no flag.

Why It Happens​

At startup, MySQL checks its own certificate against its own CA, and only warns if that fails. A certificate without CA:TRUE can't sign anything, by the rules, so the check fails.

The Fix​

Make the CA with the flag stated in the command, so that it doesn't depend on any configuration file:

Terminal
openssl req -x509 -newkey rsa:2048 -nodes -days 3650 -keyout ca-key.pem -out ca.pem -subj "/CN=Inventory Demo CA" -addext "basicConstraints=critical,CA:TRUE" -addext "keyUsage=critical,keyCertSign,cRLSign"

Then sign the server's certificate again with the new CA, because the old one's signature came from the old CA. How to Create a Certificate Authority with openssl has every step. Restart MySQL, or run ALTER INSTANCE RELOAD TLS.

After the Fix​

Terminal
openssl verify -CAfile ca.pem server-cert.pem
Output
server-cert.pem: OK

And in MySQL's log, only these remain:

Output
2026-11-06T06:26:44.390179Z 0 [Warning] [MY-010068] [Server] CA certificate /etc/mysql/certs/ca.pem is self signed.
2026-11-06T06:26:44.390231Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.

The self signed line is normal for a CA. MY-010068 explains it.

openssl verify printing server-cert.pem: OK, and MySQL's log with no MY-015011 warning.

Common Mistakes​

MistakeWhat happensDo this instead
Trusting the "configured to support TLS" lineIt appears despite the warningSearch the log for MY-0150
Making a new CA and keeping the old server certificateThe signature doesn't matchSign it again
Only testing with SslMode=RequiredIt doesn't check anythingTest with VerifyCA

Troubleshooting​

SymptomLikely causeFix
because certificate has expiredThe server's certificate has run outThe fix
[ERROR] [MY-000059] … Unable to get private keyMySQL can't read the keyThe fix

Conclusion​

MY-015011 with invalid CA certificate means the CA file isn't marked as a CA. State basicConstraints=critical,CA:TRUE when you make it, and sign the server's certificate again.

Additional Resources​

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.