Use different options to enforce SSL on MysQL for PHP 8.4 and 8.5

This commit is contained in:
Alejandro Celaya
2026-06-18 16:50:36 +02:00
parent a6131b30b9
commit fdcfb68e33
+10 -5
View File
@@ -33,12 +33,17 @@ return (static function (): array {
};
$driverOptions = match ($driver) {
'mssql' => ['TrustServerCertificate' => 'true'],
'maria', 'mysql' => !$useEncryption
? []
: [
1008 => '', // Pdo\Mysql::ATTR_SSL_CA: Require connections to be encrypted
1013 => false, // Pdo\Mysql::ATTR_SSL_VERIFY_SERVER_CERT: Allow any certificate
'maria', 'mysql' => match (true) {
!$useEncryption => [],
PHP_VERSION_ID < 80_500 => [
1007 => true, // PDO::MYSQL_ATTR_SSL_KEY: Require using SSL
1014 => false, // PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT: Trust any certificate
],
default => [
1008 => '', // Pdo\Mysql::ATTR_SSL_CA: Require connections to be encrypted
1013 => false, // Pdo\Mysql::ATTR_SSL_VERIFY_SERVER_CERT: Trust any certificate
],
},
'postgres' => !$useEncryption
? []
: [