XF 1.5 Enable SSL for database connection??? Setup for config.php file...

While I suspect not too many people will find this useful, I wanted to share this as I ran into a series of events that requires me to use xf 1.5 for a while longer, and our MySQL connections are required to go over SSL.

It should be possible to modify the library/Zend/Db/Adaptor/Mysqli.php file to include the SSL support that is required. This is based on connecting to an Managed Azure MySQL server, but would imagine it should work for Linode, or other managed servers.

Around line 300 should be
Code:
$this->connection = mysqli_init();
Add this line after it
Code:
mysqli_ssl_set($this->_connection,NULL,NULL, "/path/to/cert.ext", NULL, NULL);


A little further down, when we make the MySQLi connection as @mysqli_real_connect, find
Code:
 $port
Change too
Code:
$port,
 MYSQLI_CLIENT_SSL

That should be it.
 
SSL support was added a few years ago.


Somewhere around 2.1.6.
 
Yup! I had no issues with XF 2.2, just need to manage a 1.5 installation until we can sort out some internal requirements :)

I wanted to both document this for myself, and hopefully for others in the future.
 
Back
Top Bottom