我正在尝试连接我的Heroku PostgreSQL数据库,但出现以下错误:
cannotEstablishConnection("FATAL: no pg_hba.conf entry for host \"37.167.93.189\", user \"clpnkpyttmdtyq\", database \"d3h6147v73mgtu\", SSL off\n")
我知道Heroku的Postgres数据库需要使用SSL连接,但我不知道如何在我的
Droplet
对象上配置连接。这是我的
postgresql.json
配置文件:{
"host": "ec2-54-163-224-108.compute-1.amazonaws.com",
"user": "clpnkpyttmdtyq",
"password": "99201aa07c48e18e7bdf210937857b85bee37cd8d8cb904381b1ddff934c7a4f",
"database": "d3h6147v73mgtu",
"port": 5432
}
也许有我不知道的 ssl
参数?
如何添加 VaporPostgresSQLProvider
:
let drop = Droplet()
// Tell the droplet to use our SQL provider service
try drop.addProvider(VaporPostgreSQL.Provider.self)
有什么想法吗?
当我尝试使用我的本地 postgres 数据库时,它可以工作,因为它不需要 SSL 连接。