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

November 20, 2017 135 views
MySQL Security Ubuntu 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?

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 0.0.0.0, 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.

Have another answer? Share your knowledge.