简体   繁体   English

Heroku Postgres无法从heroku应用程序连接

[英]Heroku Postgres can't connect from heroku app

So I have a go rest api running on Heroku. 所以我在Heroku上运行了一个休息api。 I had the free tier version but now we have moved the app to production and upgraded to a standard-0 database. 我有免费的分层版本,但现在我们已将应用程序移至生产并升级到标准0数据库。 None of my code changed the only thing that changed were environmental variables to connect to the database. 我的代码都没有改变唯一改变的是连接到数据库的环境变量。 However, when I try to connect to the database I get this error: 但是,当我尝试连接到数据库时,我收到此错误:

[BRONZE] [5-1] sql_error_code = 28000 FATAL: no pg_hba.conf entry for host "54.234.***.***", user "ub21ndj3*****", database "d8useg2o3****", SSL off

From my understanding its an SSL issue. 从我的理解它的SSL问题。 What I don't understand is my app is running on Heroku servers so I shouldn't need to create a tls config to connect to the database and the same code was working with the previous database. 我不明白的是我的应用程序在Heroku服务器上运行,因此我不需要创建一个tls配置来连接到数据库,并且相同的代码正在使用以前的数据库。 Would there be another issue why I'm getting this error? 还有另一个问题我为什么会收到这个错误?

Heroku's standard databases and above require SSL connections as of April, 2016. You can see the Changelog entry here . Heroku的standard数据库及以上版本需要SSL连接,截至2016年4月。您可以在此处查看Changelog条目。 You were able to use the same application code on a hobby database because they do not have the same restriction. 您可以在hobby数据库上使用相同的应用程序代码,因为它们没有相同的限制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM