Encrypt database connection for perl and mysql using dbi

63 views Asked by At

We are connecting to mysql database from perl using DBI. The connection string has dns as $dsn = "DBI:mysql:database=test;host=myhost.portal.com;port=3306;";. But this connection is made using cleartext. We want to encrypt connection.

Which parameter we have to pass to make sure connection between application and mysql are encrypted or secure?

I check, there is mysql_ssl parameter, but not sure, does this encrypt the database connection.

1

There are 1 answers

0
brian d foy On BEST ANSWER

The docs seems to answer this directly:

mysql_ssl
    A true value turns on the CLIENT_SSL flag when connecting to 
    the  MySQL server and enforce SSL encryption. ... This means that
    your communication with the server will be encrypted.

perl5-dbi/DBD-mysql#110 is also interesting reading.