From 0bc9bd9281baf253ad266b00e5391e91ff309325 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 10 Dec 2022 19:40:33 +0100 Subject: [PATCH] Added TrustServerCertificate=true to mssql connections --- config/autoload/entity-manager.global.php | 3 +++ config/test/test_config.global.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/config/autoload/entity-manager.global.php b/config/autoload/entity-manager.global.php index 5a75ca6b..58899217 100644 --- a/config/autoload/entity-manager.global.php +++ b/config/autoload/entity-manager.global.php @@ -42,6 +42,9 @@ return (static function (): array { 'port' => EnvVars::DB_PORT->loadFromEnv($resolveDefaultPort()), 'unix_socket' => $isMysqlCompatible ? EnvVars::DB_UNIX_SOCKET->loadFromEnv() : null, 'charset' => $resolveCharset(), + 'driverOptions' => $driver !== 'mssql' ? [] : [ + 'TrustServerCertificate' => 'true', + ], ], }; diff --git a/config/test/test_config.global.php b/config/test/test_config.global.php index 678e1b05..368a5f4e 100644 --- a/config/test/test_config.global.php +++ b/config/test/test_config.global.php @@ -101,6 +101,9 @@ $buildDbConnection = static function (): array { 'user' => 'sa', 'password' => 'Passw0rd!', 'dbname' => 'shlink_test', + 'driverOptions' => [ + 'TrustServerCertificate' => 'true', + ], ], default => [ // mysql and maria 'driver' => 'pdo_mysql',