## Installation

### Connecting WW to a remote mysql database over a secure (ssl) connection

by Michael Gage -
Number of replies: 0
Advise for connecting WeBWorK up to a remote mysql database using secure communications (ssl).

* These notes are from Henry Agnew at UCDavis who has set WeBWorK up to work with LibreTexts.

The standard dbi configuration in site.conf reads:

 # The database dsn is the path to the WeBWorK database which you have created.
 # Unless you have given the database a different name or the database resides on another
 # server you do not need to change this first value.
 # The format is dbi:mysql:[databasename] for databases on the local machine
 # For a remote database the format is dbi:mysql:[databasename]:[hostname]:[port]
 $database_dsn ="dbi:mysql:webwork"; $database_storage_engine = 'myisam';

For ssl communication Henry used:
\$database_dsn ="dbi:mysql:webwork:webwork-secure-do-user-3930413-0.db.ondigitalocean.com:25060;mysql_ssl=1;mysql_ssl_ca_file=/mnt/c/Users/Henry/Desktop/Perl/ca-certificate.crt"

"The only change that I needed to do was modify the DBI string a bit and remove the parts about client keys. Basically, you can enable ssl support in WeBWorK just by adding mysql_ssl=1;mysql_ssl_ca_file=/path/to/ca-certificate.crt. I think the issue I was having before was bad permissions on the certificate and my inclusion of the client keys which are not necessary.

Here is my working DBI in my webwork configuration: "dbi:mysql:webwork:webwork-secure-do-user-3930413-0.db.ondigitalocean.com:25060;mysql_ssl=1;mysql_ssl_ca_file=/mnt/c/Users/Henry/Desktop/Perl/ca-certificate.crt"

If WeBWorK has a wiki, I would recommend adding this somewhere incase anyone else wants to use an SSL MySQL database.
-Henry Agnew"