mirror of https://github.com/buster-so/buster.git
Merge pull request #763 from buster-so/staging
Update PostgreSQL adapter SSL configuration to allow self-signed cert…
This commit is contained in:
commit
d6e2c70bcf
|
@ -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,9 +51,10 @@ 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
|
||||
? { rejectUnauthorized: false } // Allow self-signed certificates
|
||||
: pgCredentials.ssl; // Use custom SSL config if provided
|
||||
config.ssl =
|
||||
pgCredentials.ssl === true || pgCredentials.ssl === undefined
|
||||
? { rejectUnauthorized: false } // Allow self-signed certificates
|
||||
: pgCredentials.ssl; // Use custom SSL config if provided
|
||||
}
|
||||
|
||||
// Handle connection timeout
|
||||
|
|
Loading…
Reference in New Issue