I'm trying to connect to a MySQL DB that requires SSL (only doing server authentication, not mutual). I have the server's CA saved as a .pem in the same directory I'm running the script from. My connection string looks like this:
ssl_settings = {'ca':'ca.pem'}
conn = MySQLdb.connect(host=HOST, user=USER, passwd=PASS, db=DB, ssl=ssl_settings}
This results in "Error 2026: SSL connection error". However, if I change ssl_settings to:
ssl_settings = {'key':'ca.pem'}
The database connects just fine and the script executes. From my understanding of the SSL parameters, 'cert' and 'key' should only be for client authentication to the server, so is there any reason the latter SSL settings seem to work and why specifying the CA file does not?
Python 2.4.3 (old, I know)
MySQL-python 1.2.1
oursql(packages.python.org/oursql) is supposed to have several advantages overMySQLdb.