Enabling Encrypted MySQL Connections

To use WHMCS with an encrypted MySQL® connection, you will need to perform additional steps to configure the necessary settings to the configuration.php file.

We added support for encrypted MySQL connections in WHMCS 8.8.

For steps to configure encrypted MySQL connections on cPanel & WHM servers, see cPanel's How to Configure MySQL SSL Connections Documentation.

You cannot configure this before or during the installation process using the browser-based installation method. Because of this, you cannot use the browser-based method if your server requires encrypted connections.

Configuration Before Installation (CLI)

To enable encrypted MySQL connections before proceeding with the CLI-based installation method:

  1. Open the configuration.php file in your preferred text editor.
  2. Update the necessary configuration settings, replacing the example values below with your server's information:
$db_tls_ca='/path/to/ca/file';
$db_tls_ca_path='/path/to/ca/directory';
$db_tls_cert='/path/to/client/cert';
$db_tls_cipher='AES256-SHA';
$db_tls_key='/path/to/client/key';
$db_tls_verify_cert='0';
Click to copy

The settings that you configure will depend on your server's configuration.

3. Proceed with installation via the command line.

Configuration During Installation (CLI)

To enable encrypted MySQL connections during the CLI-based installation process, use the -c or --config options while running the command-line installation script.

Include the following lines in your JSON input, replacing the example values below with your server's information:

"db_tls_ca":"'/path/to/ca/file'",
"db_tls_ca_path":"'/path/to/ca/directory'",
"db_tls_cert":"'/path/to/client/cert'",
"db_tls_cipher":"'AES256-SHA'",
"db_tls_key":"'/path/to/client/key'",
"db_tls_verify_cert":"'0'",
Click to copy

The settings that you configure will depend on your server's configuration.

Configuration After Installation (CLI or Browser)

To enable encrypted MySQL connections after you have completed installation:

  1. Open the configuration.php file in your preferred text editor.
  2. Update the necessary configuration settings, replacing the example values below with your server's information:
$db_tls_ca='/path/to/ca/file';
$db_tls_ca_path='/path/to/ca/directory';
$db_tls_cert='/path/to/client/cert';
$db_tls_cipher='AES256-SHA';
$db_tls_key='/path/to/client/key';
$db_tls_verify_cert='0';
Click to copy

The settings that you configure will depend on your server's configuration.