Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: a_b on July 26, 2017, 01:24:11 AM

Title: Is it possible to connect to MySQL through SSL with Roundcube?
Post by: a_b on July 26, 2017, 01:24:11 AM
How can we configure Roundcube to connect to the MySQL database via SSL?

Here, the MySQL server is not on the same computer as the web server, so we would like to force all connections to it through SSL by having all MySQL users flagged with the REQUIRE SSL mysql flag (the 'mysql' database 'user' table 'ssl_type' field is set to "ANY") . However, it does not seem to be possible to tell Roundcube to open the MySQL connection using SSL .

Anyone has a solution for this?

Thx.
Title: Re: Is it possible to connect to MySQL through SSL with Roundcube?
Post by: alec on July 26, 2017, 02:06:51 AM
You can add arguments to the DSN string, i.e. at the end ?ca=something1&capath=something2&cert=something3&cipher=something4&key=something5.
Title: Re: Is it possible to connect to MySQL through SSL with Roundcube?
Post by: a_b on July 26, 2017, 02:28:10 AM
The only way I was able to make it work so far is to change the roundcubedir/lib/Roundcube/rcube_db.php file and within it the function dsn_options($dsn) to include a

$result[PDO::MYSQL_ATTR_SSL_CA] = '/path/to/pem/file/file.pem';

However, this kind of hacking I do not like at all...
So far, I did not figure out how to properly modify the roundcubedir/config/config.inc.php value for  $config['db_dsnw'] =  'mysqli://...dsn string...'  to work