SSL is not being used to secure our connection to MySQL on Ubuntu 16.04

Posted November 20, 2017 8.1k views
MySQLSecurityUbuntu 16.04

I have followed this tutorial here “How To Configure SSL/TLS for MySQL on Ubuntu 16.04 ” and “How To Set Up a Remote Database to Optimize Site Performance with MySQL on Ubuntu 16.04 ”.

In the log below, the haveopenssl and havessl variables read “YES”. Furthermore, the sslca, sslcert, and sslkey variables have been populated with the names of the relevant certificates that we generated:
mysql> SHOW VARIABLES LIKE ’%ssl%’;
| Variable
name | Value |
| haveopenssl | YES |
| have
ssl | YES |
| sslca | ca.pem |
| ssl
capath | |
| sslcert | server-cert.pem |
| ssl
cipher | |
| sslcrl | |
| ssl
crlpath | |
| ssl_key | server-key.pem |
9 rows in set (0.01 sec)

However, when I check the connection details again, the specific SSL cipher is not displayed, indicating that SSL is not being used to secure our connection. See details below:

Current database:

SSL: Not in use
Connection: Localhost via UNIX socket

What am I doing wrong?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

You’re connecting via a unix socket (which is basically a magical file) - You don’t need SSL there, because the connection is local and doesn’t go via the network.

Try asking mysql to listen on localhost, and then connecting to that port instead of the unix sockets that mysql uses by default.

  • I set MYSQL to listen on, I created a user required to connect over SSL from client server. This fixed the problem in this case. Thank you alastairc, your response pointed me in the right direction.