Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy on Heroku+postgres fails due to lack of SSL support #17

Open
gheja opened this issue Sep 13, 2021 · 0 comments
Open

Deploy on Heroku+postgres fails due to lack of SSL support #17

gheja opened this issue Sep 13, 2021 · 0 comments
Assignees

Comments

@gheja
Copy link

gheja commented Sep 13, 2021

When deploying to Heroku i get

original: error: no pg_hba.conf entry for host "54.227.xxx.xxx", user "xxx", database "xxx", SSL off
at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:287:98)
at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (node:events:394:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Socket.Readable.push (node:internal/streams/readable:228:10)
at TCP.onStreamRead (node:internal/stream_base_commons:199:23) {

It looks like the Heroku's postgres database requires an SSL connection but Sequelize is not using it by default.

Adding the following in lib/storage.js tells Sequelize to always use SSL (which might not be the ideal solution):

const sequelize = new Sequelize(url, { logging: false });
const sequelize = new Sequelize(url, { logging: false, dialectOptions: { ssl: { require: true, rejectUnauthorized: false } } });
tricsi pushed a commit that referenced this issue Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants