gpt4 book ai didi

postgresql - Heroku Postgres 数据库计划更改导致应用程序崩溃

转载 作者:太空宇宙 更新时间:2023-11-03 14:08:06 24 4
gpt4 key购买 nike

我刚刚将 heroku 应用程序的数据移动到更新版本的更大数据库中。重新启动应用程序时,出现错误,在连接到 heroku 之外的数据库时已被广泛讨论。

app[web.1]: Caused by: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "XX.XX.XX.XX", user "12345678901234", database "12345678901234", SSL off

heroku FAQ 声明:

You are attempting to establish a database connection without SSL. SSL is required for connections [...] for all connections on some newer databases on -0 and -2 plans. Please see the documentation for your postgres driver on how to establish encrypted connections.

我无法访问我的 heroku 实例的 postgres 选项,是吗?我是否遗漏了任何简单的信息?

其他信息:我正在使用 Play Framework 2.3.7 和 Java。连接由 Heroku 在环境变量中使用不可变值处理。基础架构使用 Heroku Toolbelt 进行管理。

最佳答案

你的 build.sbt 中可能有这样的东西:

"postgresql" % "postgresql" % "9.1-901-1.jdbc4"

改成这样:

"org.postgresql" % "postgresql" % "9.4.1208"

这将默认使用 SSL,如 Heroku Postgresql documentation 中所述.

如果无法升级库,则必须手动将这些参数添加到 DATABASE_URL

ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory

关于postgresql - Heroku Postgres 数据库计划更改导致应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36941475/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com