fix: use libpq ssl semantics for runtime postgres (#1143)
This commit is contained in:
@@ -154,6 +154,7 @@ test("postgres pool config makes HWLAB_CLOUD_DB_SSL_MODE authoritative over URL
|
||||
|
||||
assert.deepEqual(required.ssl, { rejectUnauthorized: false });
|
||||
assert.equal(new URL(required.connectionString).searchParams.get("sslmode"), "require");
|
||||
assert.equal(new URL(required.connectionString).searchParams.get("uselibpqcompat"), "true");
|
||||
});
|
||||
|
||||
test("configured postgres runtime passes normalized pool config to pg", async () => {
|
||||
|
||||
@@ -1356,6 +1356,7 @@ function normalizePostgresConnectionStringForSslMode(dbUrl, sslMode) {
|
||||
}
|
||||
if (sslMode !== "disable") {
|
||||
url.searchParams.set("sslmode", "require");
|
||||
url.searchParams.set("uselibpqcompat", "true");
|
||||
}
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user