Wordpress ==> SSL ==> MySQL is this configuration possible?

Kyoku picture Kyoku · Aug 22, 2011 · Viewed 8.7k times · Source

I am trying to put SSL encryption between my Wordpress application and its MySQL database, is anyone aware of a solution/tutorial for this? Haven't managed to find anything on Google or the Wordpress codex.

Answer

Matt Woodward picture Matt Woodward · Aug 10, 2017

Further to @ticoombs response, and after some digging / testing, I found that by changing the constant defined in wp-config.php (in the root directory) to the following it worked!

define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);

...note the extra "I" in MYSQLI_CLIENT_SSl.

Symptoms: The symptom I observed was that the call to mysql_connect in /wp-includes/wp-db.php was generating a warning that parameter 8 (i.e. $client_flags) was not an integer.

Version: Vanilla install of 4.8.1, running on php 7.0