SSL connection error when using mysqyl-python connector

Viewed 1829

I've set up a running instance of mysql (and can log in as root or other users successfully via the command line), but when attempting to connect using:

from mysql import connector 
conn = connector.connect(user='root', password='...', host='127.0.0.1')

I get the error:

2026 (HY000): SSL connection error: SSL_CTX_set_tmp_dh failed

I'm quite a newbie to mysql, so sorry if this is an obvious issue, but any help will be appreciated.

If it helps, here is the mysql status when I run it from the command line:

mysql  Ver 8.0.13 for Linux on x86_64 (MySQL Community Server - GPL)

Connection id:      32
Current database:   
Current user:       root@localhost
SSL:            Not in use
Current pager:      stdout
Using outfile:      ''
Using delimiter:    ;
Server version:     8.0.13 MySQL Community Server - GPL
Protocol version:   10
Connection:     Localhost via UNIX socket
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    utf8mb4
Conn.  characterset:    utf8mb4
UNIX socket:        /var/run/mysqld/mysqld.sock
Uptime:         1 hour 6 min 28 sec
1 Answers

Have you run the mysql_ssl_rsa_setup command? As per the documentation:

This program creates the SSL certificate and key files and RSA key-pair files required to support secure connections using SSL and secure password exchange using RSA over unencrypted connections

Related