MySQL 5.7 – Disable use of SSL connection

MySQLmysql-5.7ssl

For some reason when setting up a server with MySQL 5.7, it was created to use SSL connections:

have_ssl=YES,
have_openssl =YES

There is no SSL configured in my.cnf.

How can I disable this option? It's for a development machine and we don't need this on it. We get an SSL authentication error, and for some reason this feature is enabled on the server while it was not configured and there is no SSL reference in the my.cnf.

I was using 5.7 and could not find a way to disable the SSL. I needed to downgrade to 5.5 (due to timestamp rounding bug on 5.6/7) and on 5.5 SSL is disabled. I just want to know if there is an option/command to change this option to disabled. In 5.5 its disabled by default.

Best Answer

I would block the SSL port using your machine's software firewall (iptables, etc). This avoids having to restart mysqld.

e.g. if your SSL port is 3307:

iptables -I INPUT -i eth0 -p tcp --dport 3307 -j DROP

Otherwise, simply add a hash at the beginning of each line containing 'ssl' in your /etc/my.cnf, then restart mysqld.

e.g.

# have_ssl...
# anything_ssl...

If you're running mysqld < 5.7.x, then you can use the ssl=0 configuration option here. That option is deprecated and will be removed in a future release, though.

However, your best bet is to block all other ports than your non-ssl port and allow ssl clients to fail attempting to connect to that port.