From b39108d46f39de7ceeef94118aec67c97d02fdf7 Mon Sep 17 00:00:00 2001 From: velz Date: Mon, 8 Dec 2025 15:08:10 +0530 Subject: [PATCH] FIX_DB_SSL --- app/Config/Database.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/Config/Database.php b/app/Config/Database.php index 4914a59..fa62fa4 100755 --- a/app/Config/Database.php +++ b/app/Config/Database.php @@ -20,6 +20,7 @@ class Database extends Config * use if no other is specified. */ public string $defaultGroup = 'default'; + public string $enableSSL; /** * The default database connection. @@ -96,5 +97,17 @@ class Database extends Config if (ENVIRONMENT === 'testing') { $this->defaultGroup = 'tests'; } + + $this->enableSSL = env('DB_SSL_ENABLE'); + + if ($this->enableSSL === true || $this->enableSSL === 'true' || $this->enableSSL === 1 || $this->enableSSL === '1') { + + + // Enable SSL authentication + $this->default['encrypt'] = [ + 'ssl_ca' => ROOTPATH . 'ca.pem', + 'ssl_verify' => true, + ]; + } } }