SSL Error with Managed MySQL Database and perl DBI
I am trying to use perl DBI and DBD::mysql on Debian 10 to connect to my Linode Managed Database. I am getting the following errors:
SSL connection error: Key usage violation in certificate has been detected
SSL connection error: The certificate is NOT trusted. The certificate issuer is unknown.
✓ Best Answer
To setup the server, I ran:
apt-get update && apt-get upgrade apt-get install build-essential apt-get install mariadb-server cpan App::cpanminus cpanm DBI cpanm DBD::mysql
I put the certificate in /usr/local/share/ca-certificates/ and ran:
In the connect parameters for DBI:mysql, I included the following in addition to the database, host, user, and password parameters:
mysql_ssl=1; mysql_ssl_ca_file=/usr/local/share/ca-certificates/database-ca-certificate.crt; mysql_ssl_verify_server_cert=0
Setting mysql_ssl_verify_server_cert to 0 or 1 did appear to impact the outcome.