连接到Heroku PostgreSQL数据库时出现身份验证错误 [英] Authentication error when connecting to Heroku PostgreSQL database

查看:104
本文介绍了连接到Heroku PostgreSQL数据库时出现身份验证错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PostgreSQL开发一个Node.js应用程序并在Heroku上托管.我的问题是我收到了这样的身份验证错误:

I'm developing a Node.js application using PostgreSQL and hosting on Heroku. My problem is that I get an authentication error like so:

14:32:05 web.1     | { [error: no pg_hba.conf entry for host "193.40.244.196", user "username", database "database_name", SSL off]
14:32:05 web.1     |   length: 168,
14:32:05 web.1     |   name: 'error',
14:32:05 web.1     |   severity: 'FATAL',
14:32:05 web.1     |   code: '28000',
14:32:05 web.1     |   detail: undefined,
14:32:05 web.1     |   hint: undefined,
14:32:05 web.1     |   position: undefined,
14:32:05 web.1     |   internalPosition: undefined,
14:32:05 web.1     |   internalQuery: undefined,
14:32:05 web.1     |   where: undefined,
14:32:05 web.1     |   file: 'auth.c',
14:32:05 web.1     |   line: '483',
14:32:05 web.1     |   routine: 'ClientAuthentication' }

这可能是SSL问题,但不应该提及此处.开箱即用应支持SSL.所以我很困惑,只能问什么可能导致此错误?

It might be an SSL problem, but it shouldn't be as mentioned here. SSL should be supported out of the box. So I'm stumped and can only ask what might cause this error?

我不确定是否必须在系统上编辑pg_hba.conf,但是我什至找不到它.

I'm not sure if I have to maybe edit the pg_hba.conf on my system, but I can't even find it.

推荐答案

自己解决这个问题,这很简单.只需通过HTTPS进行连接

Ran into this myself, it's a simple fix. Just connect over HTTPS instead

这篇关于连接到Heroku PostgreSQL数据库时出现身份验证错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆