Use 'prefer' as the default value for DB_SSLMODE in the streaming API configuration

This commit is contained in:
Guillaume JORANDON 2024-09-09 16:13:21 -04:00 committed by GitHub
parent a021dee642
commit 66e690d13e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,19 +82,17 @@ export function configFromEnv(env, environment) {
} else if (Object.hasOwn(pgConfigs, environment)) { } else if (Object.hasOwn(pgConfigs, environment)) {
baseConfig = pgConfigs[environment]; baseConfig = pgConfigs[environment];
if (env.DB_SSLMODE) { switch(env.DB_SSLMODE) {
switch(env.DB_SSLMODE) { case 'disable':
case 'disable': baseConfig.ssl = false;
case '': break;
baseConfig.ssl = false; case 'no-verify':
break; baseConfig.ssl = { rejectUnauthorized: false };
case 'no-verify': break;
baseConfig.ssl = { rejectUnauthorized: false }; case 'prefer':
break; default:
default: baseConfig.ssl = {};
baseConfig.ssl = {}; break;
break;
}
} }
} else { } else {
throw new Error('Unable to resolve postgresql database configuration.'); throw new Error('Unable to resolve postgresql database configuration.');