Skip to content

Commit c9cf740

Browse files
DEMOS-1850 Update the prismaClient to ignore self signed SSL cert errors. (#1021)
* Update the prismaClient to ignore self signed SSL cert errors. * Fix tests
1 parent 409ca63 commit c9cf740

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

server/src/prismaClient.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ describe("prismaClient", () => {
8383
mod.prisma();
8484

8585
expect(prismaPgCtorMock).toHaveBeenCalledWith(
86-
{ connectionString: process.env.DATABASE_URL },
86+
{
87+
connectionString: process.env.DATABASE_URL,
88+
ssl: { rejectUnauthorized: false },
89+
},
8790
{ schema: "demos_app" }
8891
);
8992
});
@@ -95,7 +98,10 @@ describe("prismaClient", () => {
9598
mod.prisma();
9699

97100
expect(prismaPgCtorMock).toHaveBeenCalledWith(
98-
{ connectionString: "not-a-url" },
101+
{
102+
connectionString: "not-a-url",
103+
ssl: { rejectUnauthorized: false },
104+
},
99105
{ schema: undefined }
100106
);
101107
});

server/src/prismaClient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const createExtendedClient = () => {
3535

3636
const adapter = new PrismaPg({
3737
connectionString,
38+
ssl: { rejectUnauthorized: false },
3839
}, {
3940
schema,
4041
});

0 commit comments

Comments
 (0)