Author Topic: Is it possible to connect to MySQL through SSL with Roundcube?  (Read 3499 times)

Offline a_b

  • Newbie
  • *
  • Posts: 2
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.

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Is it possible to connect to MySQL through SSL with Roundcube?
« Reply #1 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.

Offline a_b

  • Newbie
  • *
  • Posts: 2
Re: Is it possible to connect to MySQL through SSL with Roundcube?
« Reply #2 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