FIX_DB_SSL
This commit is contained in:
parent
2430c18ba3
commit
b39108d46f
@ -20,6 +20,7 @@ class Database extends Config
|
|||||||
* use if no other is specified.
|
* use if no other is specified.
|
||||||
*/
|
*/
|
||||||
public string $defaultGroup = 'default';
|
public string $defaultGroup = 'default';
|
||||||
|
public string $enableSSL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default database connection.
|
* The default database connection.
|
||||||
@ -96,5 +97,17 @@ class Database extends Config
|
|||||||
if (ENVIRONMENT === 'testing') {
|
if (ENVIRONMENT === 'testing') {
|
||||||
$this->defaultGroup = 'tests';
|
$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,
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user