From add48537c6cd3d44c7065b763cf60b432b3e71a5 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Wed, 7 Aug 2024 14:39:05 +0200 Subject: [PATCH] syn2mas: only set the SSL options if we set any of them --- tools/syn2mas/src/db.mts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/syn2mas/src/db.mts b/tools/syn2mas/src/db.mts index 53eeb1c4b..1f1dcd249 100644 --- a/tools/syn2mas/src/db.mts +++ b/tools/syn2mas/src/db.mts @@ -57,7 +57,9 @@ export async function connectToSynapseDatabase({ database.args.sslkey && (ssl.key = await readFile(database.args.sslkey)); database.args.sslpassword && (ssl.passphrase = database.args.sslpassword); - connection.ssl = ssl; + if (Object.keys(ssl).length > 0) { + connection.ssl = ssl; + } return knex({ client: "pg", @@ -103,7 +105,9 @@ export async function connectToMASDatabase({ ssl.key = await readFile(database.ssl_key_file); } - connection.ssl = ssl; + if (Object.keys(ssl).length > 0) { + connection.ssl = ssl; + } return knex({ client: "pg",