Я борюсь с ошибкой соединения с базой данных:
Unable to connect to the database: ConnectionError [SequelizeConnectionError]: self signed certificate
Здесь у вас есть код, который я использую - комментируемая часть не работает, ошибка все еще появляется:
// const pg = require('pg');
// pg.defaults.ssl = true;
// const fs = require('fs');
// const rdsCa = fs.readFileSync(__dirname + '/rds-combined-ca-bundle.pem');
const sequelize = new Sequelize('xxxx', 'xxxxxx', 'xxxxxxxx',{
host: 'xxxxxx.eu-west-1.compute.amazonaws.com',
dialect: 'postgres',
ssl: true,
protocol: "postgres",
logging: true,
dialectOptions: {
ssl: true
}
});
sequelize
.authenticate()
.then(() => {
console.log('Connection has been established successfully.');
})
.catch(err => {
console.error('Unable to connect to the database:', err);
});
База данных основана на Heroku.
Не могли бы вы помочь мне решить проблему?