mejdi Radhouani
mejdi Radhouani

Reputation: 123

Message "28000: no pg_hba.conf entry for host \"xx.xxx.xxx.xxxx\", user \"User", database \"databasename\", SSL off"

I 'm trying to connect postgresql database remotely ( Heroku ). I use ASP Web api but always i have the same exception :Message "28000: no pg_hba.conf entry for host \"xx.xxx.xxx.xxxx\", user \"User", database \"databasename\", SSL off" I search some solution by editing the pg_hba.conf file and i add : host databasename username xx.xxx.xxx.xxxx md5 and no change .

Upvotes: 10

Views: 9552

Answers (3)

CodeArt
CodeArt

Reputation: 898

host all all 0.0.0.0/0 trust

or host all all 192.168.0.0/24 trust

of course, you also need

listen_address = '*'

Upvotes: 2

Add sslmode=Require; and Trust Server Certificate=true; in your connection string.It will work for sure.

Upvotes: 28

RangerRanger
RangerRanger

Reputation: 2493

Heroku Postgres requires client connections are made with SSL. Configure your application to require SSL on database connections and this error will go away.

Upvotes: 4

Related Questions