【问题标题】:command line: heroku pg:psql ... gets 'psql: error: SSL error: certificate verify failed'命令行:heroku pg:psql ... 获取“psql:错误:SSL 错误:证书验证失败”
【发布时间】:2021-12-15 19:13:26
【问题描述】:

heroku pg:psql 突然不高兴了。

π main ✗ ❯ heroku pg:psql postgresql-xyz --app xyz
    --> Connecting to postgresql-xyz
    psql: error: SSL error: certificate verify failed
    FATAL:  no pg_hba.conf entry for host "47.123.123.123", user "abc", database "xyz", SSL off
     ▸    psql exited with code 2

π main ❯ heroku -v
heroku/7.59.1 darwin-x64 node-v12.21.0

我注意到“SSL 关闭”。如何通过 HEROKU cli 打开?或者它是 heroku.com 的“Config Vars”中的设置?

【问题讨论】:

    标签: ssl heroku command-line-interface psql


    【解决方案1】:

    在 Mac OS 上,这可以解决问题。
    Postgres 似乎在 ~.postgresql 文件夹中安装了“root.crt”。不知何故,在连接字符串中将其称为“root.key”。

    psql "sslmode=require sslrootcert=/Users/abc123/.postgresql/root.key user=abc password=xyz host=ec1.compute-1.amazonaws.com dbname=d123"
    

    【讨论】:

      猜你喜欢
      • 2019-09-08
      • 2015-06-05
      • 2015-11-19
      • 1970-01-01
      • 2018-06-07
      • 1970-01-01
      • 2014-01-31
      • 2018-03-16
      相关资源
      最近更新 更多