After upgrading Ubuntu to 20.04 and attempting to connect to MySQL, I encountered the following error:
ERROR 2026 (HY000): SSL connection error: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
I was unable to connect to MySQL.
This issue occurs whether I start a new EC2 instance from an Ubuntu 20.04 image or upgrade from Ubuntu 18 to 20 using do-release-upgrade. The same error appears whether I connect using the mysql command or from Django.
There is a solution on Stack Overflow:
https://stackoverflow.com/questions/61649764/mysql-error-2026-ssl-connection-error-ubuntu-20-04
1. Open the file with sudo vim /usr/lib/ssl/openssl.cnf
2. Add the following line at the beginning of the file:
openssl_conf = default_conf
3. Add the following lines at the end of the file:
[ default_conf ]
ssl_conf = ssl_sect
[ssl_sect]
system_default = ssl_default_sect
[ssl_default_sect]
MinProtocol = TLSv1
CipherString = DEFAULT:@SECLEVEL=1
This solution resolved the issue for me.
Comments