我的 Node.js 应用程序能够通过npm pg
模块使用本地 Postgres 数据库。我也可以通过命令行和heroku pg:psql
命令连接到 Heroku 托管的 Postgres 数据库(免费的业余爱好开发计划)。
但是当我的 Node.js 应用程序尝试查询 Heroku 托管的 Postgres 数据库时,我收到一个self signed certificate
错误。
这是有self signed certificate
错误的输出:
(node:2100) UnhandledPromiseRejectionWarning: Error: self signed certificate
at TLSSocket.onConnectSecure (_tls_wrap.js:1051:34)
at TLSSocket.emit (events.js:189:13)
at TLSSocket._finishInit (_tls_wrap.js:633:8)
(node:2100) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: …
Run Code Online (Sandbox Code Playgroud)