Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 .

like image 495
mejdi Radhouani Avatar asked May 24 '17 14:05

mejdi Radhouani


1 Answers

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

like image 151
Chandra Vijay Vishwakarma Avatar answered Sep 24 '22 13:09

Chandra Vijay Vishwakarma