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

元气小坏坏 提交于 2020-07-20 11:44:12

问题


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 .


回答1:


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




回答2:


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




回答3:


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 = '*'


来源:https://stackoverflow.com/questions/44161509/message28000-no-pg-hba-conf-entry-for-host-xx-xxx-xxx-xxxx-user-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!