From 65969f7ee59a3c60a6a22b45e5c866eb60f4a878 Mon Sep 17 00:00:00 2001 From: Tom Udding Date: Thu, 31 Oct 2024 17:22:57 +0100 Subject: [PATCH] fix: sync script not using SSL Failed in production because SSL was not enabled for the MariaDB side. The PostgreSQL side now also requires SSL. --- importdb.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/importdb.php b/importdb.php index d494beeec9..58cf749a81 100644 --- a/importdb.php +++ b/importdb.php @@ -78,7 +78,7 @@ $pgconn = new PDO( sprintf( - 'pgsql:host=%s;port=%d;dbname=%s;options=\'--client_encoding=%s\'', + 'pgsql:host=%s;port=%d;dbname=%s;sslmode=require;options=\'--client_encoding=%s\'', $config['host'], $config['port'], $config['dbname'], @@ -107,6 +107,8 @@ [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES ' . $params['charset'] . ' COLLATE ' . $params['collate'], + PDO::MYSQL_ATTR_SSL_CAPATH => '/etc/ssl/certs/', + PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => true, ], ); } catch (Exception|Error $e) {