Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit 5cdae81

Browse files
committed
syn2mas: only set the SSL options if we set any of them
1 parent c61a52a commit 5cdae81

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/syn2mas/src/db.mts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export async function connectToSynapseDatabase({
5757
database.args.sslkey && (ssl.key = await readFile(database.args.sslkey));
5858
database.args.sslpassword && (ssl.passphrase = database.args.sslpassword);
5959

60-
connection.ssl = ssl;
60+
if (Object.keys(ssl).length > 0) {
61+
connection.ssl = ssl;
62+
}
6163

6264
return knex({
6365
client: "pg",
@@ -103,7 +105,9 @@ export async function connectToMASDatabase({
103105
ssl.key = await readFile(database.ssl_key_file);
104106
}
105107

106-
connection.ssl = ssl;
108+
if (Object.keys(ssl).length > 0) {
109+
connection.ssl = ssl;
110+
}
107111

108112
return knex({
109113
client: "pg",

0 commit comments

Comments
 (0)