From 6bb5555a736b73ef051224bf46ddd42d4941ec30 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 28 Nov 2016 19:25:26 -0800 Subject: [PATCH] Fixes #2980 - enable MySQL SSL settings --- .env.example | 10 ++++++++++ config/database.php | 6 ++++++ 2 files changed, 16 insertions(+) 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' => [