Skip to content

A free open source IT asset/license management system

Fixes #2980 - enable MySQL SSL settings

snipe6bb5555a736b
diff --git a/.env.example b/.env.example
index f9a3012b94..e23d1bb2cc 100644
--- a/.env.example
+++ b/.env.example
@@ -20,6 +20,16 @@ DB_PASSWORD=null
DB_PREFIX=null
DB_DUMP_PATH='/usr/bin'
+# --------------------------------------------
+# OPTIONAL: SSL DATABASE SETTINGS
+# --------------------------------------------
+DB_SSL=true
+DB_SSL_KEY_PATH=null
+DB_SSL_CERT_PATH=null
+DB_SSL_CA_PATH=null
+DB_SSL_CIPHER=null
+
+
# --------------------------------------------
# REQUIRED: OUTGOING MAIL SERVER SETTINGS
# --------------------------------------------
diff --git a/config/database.php b/config/database.php
index e87d990745..0806c1dc99 100755
--- a/config/database.php
+++ b/config/database.php
@@ -73,6 +73,12 @@ return [
'dump_command_path' => env('DB_DUMP_PATH', '/usr/local/bin'), // only the path, so without 'mysqldump'
'dump_command_timeout' => 60 * 5, // 5 minute timeout
'dump_using_single_transaction' => true, // perform dump using a single transaction
+ 'options' => (env('DB_SSL')) ? [
+ PDO::MYSQL_ATTR_SSL_KEY => env('DB_SSL_KEY'), // /path/to/key.pem
+ PDO::MYSQL_ATTR_SSL_CERT => env('DB_SSL_CERT'), // /path/to/cert.pem
+ PDO::MYSQL_ATTR_SSL_CA => env('DB_SSL_CA'), // /path/to/ca.pem
+ PDO::MYSQL_ATTR_SSL_CIPHER => env('DB_SSL_CIPHER')
+ ] : []
],
'pgsql' => [