Skip to content

Commit

Permalink
Check ob Konstante MYSQL_ATTR_SSL_VERIFY_SERVER_CERT existiert (#5929)
Browse files Browse the repository at this point in the history
  • Loading branch information
gharlan committed Feb 12, 2024
1 parent 3fde307 commit f7b2976
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion redaxo/src/core/lib/sql/sql.php
Expand Up @@ -122,7 +122,11 @@ protected function selectDB($db)
PDO::MYSQL_ATTR_SSL_CA => $dbconfig->sslCa,
];
}
$options[PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = $dbconfig->sslVerifyServerCert;

// available only with mysqlnd
if (defined('PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT')) {
$options[PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = $dbconfig->sslVerifyServerCert;
}

$conn = self::createConnection(
$dbconfig->host,
Expand Down

0 comments on commit f7b2976

Please sign in to comment.