Hi Seth,

first install the server:
sudo apt install mariadb-server

then the PyMySQL:
python3 -m pip install PyMySQL

then create a ca-cert:
openssl genrsa 2048 > ca-key.pem
openssl req -new -x509 -nodes -days 3600 -key ca-key.pem -out ca-cert.pem

then run this python-test-script:
import os
import pymysql

#pymysql.connections.DEBUG = True
#pymysql._auth.DEBUG = True

host = "127.0.0.1"
port = 3306

ca = os.path.expanduser("~/ca-cert.pem")
ssl = {'ca': ca, 'check_hostname': False}

user = 'user'
passwd = 'passwd'


def test_ssl():
    con = pymysql.connect(user=user, password=passwd, host=host, port=port, 
ssl=ssl)
    con.close()

test_ssl()

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1888101

Title:
  'unsupported protocol' error when using PyMySQL

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1888101/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to