mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
Mysql PDO options to support SSL/TLS client communication (#15832)
* Fixed mysql connection to include additional options for SSL Cert and Key. This allows for TLS client communication. * Modified config options for mysql database to make SSL/TLS settings optional. SSL/TLS CA, CERT, and KEY are optional. If they are not provided the array_filter() will remove them. MYSQL_ATTR_SSL_VERIFY_SERVER_CERT is outside array_filter() because the function will remove the option if it is falsey; however there are times when that variable must be set to false. * fix style --------- Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
parent
c641b3fa94
commit
8027492a29
@ -66,8 +66,12 @@ return [
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'sslmode' => env('DB_SSLMODE', 'disabled'),
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
'options' => extension_loaded('pdo_mysql') ? [
|
||||
PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => env('MYSQL_ATTR_SSL_VERIFY_SERVER_CERT', false),
|
||||
] + array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
PDO::MYSQL_ATTR_SSL_CERT => env('MYSQL_ATTR_SSL_CERT'),
|
||||
PDO::MYSQL_ATTR_SSL_KEY => env('MYSQL_ATTR_SSL_KEY'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user