0





231

Advertisement

I'm running a Postgres DB and a node app on Heroku. When I try to do

app.use(session({
  store: new pgSession({
    conString: process.env.DATABASE_URL
  }),
  secret: 'my-super-secret-session',
  resave: false,
  cookie: {
    maxAge: 7 * 24 * 60 * 60 * 1000
  }
}));

I get a complaint: error: no pg_hba.conf entry for host "1.2.3.4", user ,myuser", database "mydb", SSL off

I assume I need to tell connect-pg-simple to use SSL somehow?

Question author Shamoon | Source

Advertisement


0


You need to add an entry in the pg_hba.conf to allow your connection.

Example:

vi $PGDATA/pg_hba.conf
host    all             all             1.2.3.4/32           md5

After saving this config file you will need to reload it by issuing a config reload command:

pg_ctl reload

Then retry the connection.

Answer author D1ll1nger