Node-postgres: no pg_hba.conf entry for host

Created on 22 Apr 2014  路  3Comments  路  Source: brianc/node-postgres

I am new to node, so forgive me if this is a silly question.
I have written a node js/express/postgress app on my local system and things work great.
I tried to move the app to the Amazon Cloud -- everything the postgress DB and node code. When the node app tries to connect to the postgress DB I see this error:
error: no pg_hba.conf entry for host "54.201.213.227", user "automation", database "automationdb", SSL off

I tried using:
var pg = require('pg').native;

but it does not help.

Most helpful comment

you probably need to set PGSSLMODE=require as an environment variable. node postgres sniffs those and will connect over SSL properly in that case

All 3 comments

you probably need to set PGSSLMODE=require as an environment variable. node postgres sniffs those and will connect over SSL properly in that case

Yes -- thanks so much for taking the time to respond.

No problemo!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dindurthy picture dindurthy  路  4Comments

frmoded picture frmoded  路  3Comments

gajus picture gajus  路  4Comments

KeynesYouDigIt picture KeynesYouDigIt  路  3Comments

Phara0h picture Phara0h  路  4Comments