--- /opt/observium/includes/db/mysqli.inc.php.orig      2020-02-08 16:03:46.778933097 +0100
+++ /opt/observium/includes/db/mysqli.inc.php   2020-02-08 16:04:06.071247386 +0100
@@ -114,6 +114,13 @@
       $client_flags |= MYSQLI_CLIENT_COMPRESS;
     }

+    if ($GLOBALS['config']['db_ssl'] && defined('MYSQLI_CLIENT_SSL'))
+    {
+      $client_flags |= MYSQLI_CLIENT_SSL;
+
+      mysqli_ssl_set($connection, $GLOBALS['config']['db_ssl_key'], $GLOBALS['config']['db_ssl_crt'], $GLOBALS['config']['db_ssl_ca'], $GLOBALS['config']['db_ssl_capath'], $GLOBALS['config']['db_ssl_cipher']);
+    }
+
     // Convert integer and float columns back to PHP numbers. Only valid for mysqlnd.
     /*
     if (defined('OBS_DB_MYSQLND') && OBS_DB_MYSQLND)
 
--- /opt/observium/includes/defaults.inc.php.orig       2020-02-08 16:05:30.586624860 +0100
+++ /opt/observium/includes/defaults.inc.php    2020-02-08 16:06:12.098301807 +0100
@@ -49,6 +49,12 @@
 #$config['db_persistent']    = FALSE;       // Whether persistent connections should be used or not. WARNING use at own risk!
 #$config['db_compress']      = FALSE;       // Use compressed protocol for the MySQL connection
 $config['db']['debug']      = TRUE;        // If TRUE store errors in DB queries into logs/db.log
+$config['db']['db_ssl']      = FALSE;        // If TRUE mysql connection uses ssl (only available with mysqli engine)
+$config['db']['db_ssl_key']  = NULL;        // path to ssl key file
+$config['db']['db_ssl_crt']  = NULL;        // path to ssl crt file
+$config['db']['db_ssl_ca']   = NULL;        // path to ssl ca file
+$config['db']['db_ssl_capath'] = NULL;      // path to ca files
+$config['db']['db_ssl_cipher'] = NULL;      // allowed ciphers to use for ssl connection

 #$config['db_host']          = 'localhost'; // DB hostname (default: localhost)
 #$config['db_user']          = 'USERNAME';