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

brianc picture brianc  路  27Comments

martinbliss picture martinbliss  路  26Comments

mramato picture mramato  路  22Comments

danbulant picture danbulant  路  34Comments

eric-elsholz picture eric-elsholz  路  51Comments