Skip to content

Commit

Permalink
Merge pull request #1915 from tomudding/fix/mariadb-ssl
Browse files Browse the repository at this point in the history
fix: sync script not using SSL
  • Loading branch information
tomudding authored Oct 31, 2024
2 parents c3a94ef + 65969f7 commit a297a93
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion importdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit a297a93

Please sign in to comment.