Skip to content

Commit

Permalink
fix: storage-[mysql,postgresql] SSL param name
Browse files Browse the repository at this point in the history
  • Loading branch information
chr33s committed Sep 12, 2023
1 parent 95e5eae commit f3ee4ab
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe('MySQLSessionStorage', () => {

it(`can successfully connect with a url string and ssl param`, async () => {
const _dbURL = new URL(dbURL);
_dbURL.searchParams.append('ssl', 'true');
_dbURL.searchParams.append('sslMode', 'DISABLED');
const storage = new MySQLSessionStorage(_dbURL.toString());
await storage.ready;
const session = new Session({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ export class MySqlConnection implements RdbmsConnection {
database: this.getDatabase(),
port: Number(this.dbUrl.port),
ssl: {
rejectUnauthorized: this.dbUrl.searchParams.get('ssl') === 'true',
rejectUnauthorized:
this.dbUrl.searchParams.get('sslMode') === 'DISABLED',
},
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe('PostgreSQLSessionStorage', () => {

it(`can successfully connect with a url string and ssl param`, async () => {
const _dbURL = new URL(dbURL);
_dbURL.searchParams.append('ssl', 'true');
_dbURL.searchParams.append('sslmode', 'disable');
const storage = new PostgreSQLSessionStorage(_dbURL.toString());
await storage.ready;
const session = new Session({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class PostgresConnection implements RdbmsConnection {
password: decodeURIComponent(this.dbUrl.password),
database: this.getDatabase(),
port: Number(this.dbUrl.port),
ssl: this.dbUrl.searchParams.get("ssl") === "true",
ssl: this.dbUrl.searchParams.get('sslmode') === 'disable',
});
}
}

0 comments on commit f3ee4ab

Please sign in to comment.