mirror of https://github.com/buster-so/buster.git
Update PostgreSQL adapter SSL configuration to allow self-signed certificates
- Modified the SSL configuration in both the PostgreSQL adapter and its tests to use { rejectUnauthorized: false } instead of a boolean true value. - Ensured consistency in handling SSL settings across the adapter and its tests.
This commit is contained in:
parent
da7af5f384
commit
f469b2a152
|
@ -43,7 +43,7 @@ describe('PostgreSQLAdapter', () => {
|
|||
database: 'testdb',
|
||||
user: 'testuser',
|
||||
password: 'testpass',
|
||||
ssl: true,
|
||||
ssl: { rejectUnauthorized: false },
|
||||
});
|
||||
expect(mockClient.connect).toHaveBeenCalled();
|
||||
});
|
||||
|
@ -130,7 +130,7 @@ describe('PostgreSQLAdapter', () => {
|
|||
|
||||
expect(Client).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
ssl: true,
|
||||
ssl: { rejectUnauthorized: false },
|
||||
})
|
||||
);
|
||||
});
|
||||
|
|
|
@ -51,7 +51,8 @@ export class PostgreSQLAdapter extends BaseAdapter {
|
|||
// Handle SSL configuration - default to true for security
|
||||
// But allow self-signed certificates to avoid connection errors
|
||||
if (pgCredentials.ssl !== false) {
|
||||
config.ssl = pgCredentials.ssl === true || pgCredentials.ssl === undefined
|
||||
config.ssl =
|
||||
pgCredentials.ssl === true || pgCredentials.ssl === undefined
|
||||
? { rejectUnauthorized: false } // Allow self-signed certificates
|
||||
: pgCredentials.ssl; // Use custom SSL config if provided
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue