You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please change the code for the below: getUserModel(attributes, options) { const sequelize = new Sequelize(postgres://${this.pgconfig.user}:${this.pgconfig.password}@${this.pgconfig.host}:${this.pgconfig.port}/${this.pgconfig.database}, { logging: false } );
to
`const isPostgresSslEnabled = process.env.DATABASE_SSL_ENABLED || false;
if (isPostgresSslEnabled) {
How can we reproduce it (as minimally and precisely as possible)?
the current as is code will not work - will get a SequelizeConnectionError
Anything else we need to know?
I have tested with the above changes to code and it worked for me
OS version
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
The text was updated successfully, but these errors were encountered:
What happened?
The fix provided through #30
is incomplete. The Sequelize function requires enabling TLS.
In the file https://github.com/hyperledger-labs/blockchain-explorer/blob/main/app/persistence/postgreSQL/PgService.ts
Please change the code for the below:
getUserModel(attributes, options) { const sequelize = new Sequelize(
postgres://${this.pgconfig.user}:${this.pgconfig.password}@${this.pgconfig.host}:${this.pgconfig.port}/${this.pgconfig.database}, { logging: false } );
to
`const isPostgresSslEnabled = process.env.DATABASE_SSL_ENABLED || false;
if (isPostgresSslEnabled) {
const sequelize = new Sequelize(
postgres://${this.pgconfig.user}:${this.pgconfig.password}@${this.pgconfig.host}:${this.pgconfig.port}/${this.pgconfig.database}
,{ logging: false, dialectOptions: { ssl: true, }, }
);
}else{
const sequelize = new Sequelize(
postgres://${this.pgconfig.user}:${this.pgconfig.password}@${this.pgconfig.host}:${this.pgconfig.port}/${this.pgconfig.database}
,{ logging: false }
);
}`
What did you expect to happen?
TLS connection should work to PostGreSQL
How can we reproduce it (as minimally and precisely as possible)?
the current as is code will not work - will get a SequelizeConnectionError
Anything else we need to know?
I have tested with the above changes to code and it worked for me
OS version
The text was updated successfully, but these errors were encountered: