简体   繁体   English

通过 SSL 将 botpress 连接到外部 postgres 数据库服务器

[英]Connecting botpress to external postgres DB server over SSL

I need to connect botpress to my external DB server which runs on a separate server from botpress.我需要将 botpress 连接到我的外部数据库服务器,该服务器在与 botpress 不同的服务器上运行。 The connection is over SSL as this is required by the DB server and cannot be switched off.连接结束 SSL 因为这是 DB 服务器要求的,不能关闭。

I can connect from the vps where botpress runs to the DB server with a python script.我可以使用 python 脚本从运行 botpress 的 vps 连接到数据库服务器。

Using the same string for DATABASE_URL=postgres:// gets me the error: no pg_hba.conf for host... SSL off对 DATABASE_URL=postgres:// 使用相同的字符串会得到错误: no pg_hba.conf for host... SSL off

Where can I enable SSL DB connection in botpress?我在哪里可以在 botpress 中启用 SSL DB 连接?

What is probably happening here is that your client first tries to connect over SSL, and gets rejected for some reason.这里可能发生的是您的客户端首先尝试通过 SSL 进行连接,但由于某种原因被拒绝。 It then automatically tries again with SSL off, and gets rejected because the pg_hba requires ssl.然后它会在关闭 SSL 的情况下自动再次尝试,但由于 pg_hba 需要 ssl 而被拒绝。 The client reports only this second error to you (or it reports both and you only notice the 2nd one), which is not the most useful one.客户端只向您报告第二个错误(或者它同时报告两个错误,而您只注意到第二个错误),这不是最有用的一个。

If you set PGSSLMODE=require or equivalent on the client, it should stop after the first try and report the first error in a clearer manner.如果您在客户端设置 PGSSLMODE=require 或等效项,它应该在第一次尝试后停止并以更清晰的方式报告第一个错误。

You also might find more details in the server log file.您还可以在服务器日志文件中找到更多详细信息。 The messages sent to the unauthenticated (presumably hostile) client can be intentionally vague.发送给未经身份验证的(可能是敌对的)客户端的消息可能故意含糊不清。

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

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