Question: We run Wordpress in a sub folder of our main .NET solution on a cloud service. We have moved our MySQL from CloudDB to Azure MySQL, however it will only connect if we set the "Enforce SSL Connection" to disabled.

The Wordpress wp-config.php has the following

```
define('DB_SSL', true);

```

I presume the issue is we need to pass a certificate, but it is not clear to me how we can set this in Wordpress so it is passed when connecting over SSL.

Answer: 
This will solve the issue by adding these lines to wp\_config.php

```
define(‘MYSQL_CLIENT_FLAGS’, MYSQLI_CLIENT_SSL);
define(‘MYSQL_SSL_CA’, getenv(‘MYSQL_SSL_CA’));
define(‘MYSQL_CLIENT_FLAGS’, MYSQLI_CLIENT_SSL | MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT );

```
The solutions that work for me, add to wp-config.php:

PHP7.x

```
define( 'MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL | 
MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT ); 
define( 'MYSQL_SSL_CA', getenv('MYSQL_SSL_CA'));

```

PHP5.x

```
define('MYSQL_CLIENT_FLAGS', MYSQL_CLIENT_SSL);
define( 'MYSQL_SSL_CA', getenv('MYSQL_SSL_CA'));

```

Source: <https://jkudo.medium.com/how-to-connection-from-wordpress-installed-on-azure-app-service-to-azure-database-for-mysql-via-2b2c37c4a7de>