From 6dee8461922985aa62d847fe3f26bdff07a838d9 Mon Sep 17 00:00:00 2001 From: Clinton Blackburn Date: Sun, 18 Dec 2022 11:09:33 -0800 Subject: [PATCH] Added support for SSL database connections (#663) Passing the `DB_SSL` environment variable can trigger the use of SSL client connections to MySQL. This is especially useful for remote/managed databases where SSL certificates are required. --- config/application.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/application.php b/config/application.php index 81b79d6792..c95118d233 100644 --- a/config/application.php +++ b/config/application.php @@ -64,6 +64,10 @@ /** * DB settings */ +if (env('DB_SSL')) { + Config::define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL); +} + Config::define('DB_NAME', env('DB_NAME')); Config::define('DB_USER', env('DB_USER')); Config::define('DB_PASSWORD', env('DB_PASSWORD'));