feat: allow self signed certificates with postgres connections (#5143)
This commit is contained in:
@ -14,6 +14,12 @@ export const typeORMCoreModuleOptions: TypeOrmModuleOptions = {
|
||||
migrationsRun: false,
|
||||
migrationsTableName: '_typeorm_migrations',
|
||||
migrations: ['dist/src/database/typeorm/core/migrations/*{.ts,.js}'],
|
||||
ssl:
|
||||
process.env.PG_SSL_ALLOW_SELF_SIGNED === 'true'
|
||||
? {
|
||||
rejectUnauthorized: false,
|
||||
}
|
||||
: undefined,
|
||||
};
|
||||
export const connectionSource = new DataSource(
|
||||
typeORMCoreModuleOptions as DataSourceOptions,
|
||||
|
||||
@ -14,6 +14,12 @@ export const typeORMMetadataModuleOptions: TypeOrmModuleOptions = {
|
||||
migrationsRun: false,
|
||||
migrationsTableName: '_typeorm_migrations',
|
||||
migrations: ['dist/src/database/typeorm/metadata/migrations/*{.ts,.js}'],
|
||||
ssl:
|
||||
process.env.PG_SSL_ALLOW_SELF_SIGNED === 'true'
|
||||
? {
|
||||
rejectUnauthorized: false,
|
||||
}
|
||||
: undefined,
|
||||
};
|
||||
export const connectionSource = new DataSource(
|
||||
typeORMMetadataModuleOptions as DataSourceOptions,
|
||||
|
||||
@ -33,6 +33,11 @@ export class TypeORMService implements OnModuleInit, OnModuleDestroy {
|
||||
BillingSubscription,
|
||||
BillingSubscriptionItem,
|
||||
],
|
||||
ssl: environmentService.get('PG_SSL_ALLOW_SELF_SIGNED')
|
||||
? {
|
||||
rejectUnauthorized: false,
|
||||
}
|
||||
: undefined,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user