我正在使用 asyncpg 在 Heroku postgresql 中使用 python 连接我的数据库:
import asyncpg
async def create_db_pool():
bot.pg_con = await asyncpg.create_pool(dsn="postgres://....", host="....amazonaws.com", user="xxx", database="yyy", port="5432", password="12345")
它运行良好,直到我收到 heroku 的电子邮件,建议我进行维护:
Maintenance (DATABASE_URL on myappname) is starting now. We will update you when it has completed.
然后出现了这个错误:
asyncpg.exceptions.InvalidAuthorizationSpecificationError: no pg_hba.conf entry for host "123.456.789.10", user "xxx", database "yyy", SSL off
我试图寻求一些帮助,比如 putssl=True
但是出现了这个错误:
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1108)
和放一样ssl="allow"
asyncpg.exceptions.InvalidPasswordError: password authentication failed for user "xxx"
我该怎么做才能解决这个问题?