RDS Aurora Postgres - Postpg_hba.conf rejects connection for host

0

Hi,

I can no longer connect to my postgres instance using my super user account, i receive the followig error: "pg_hba.conf rejects connection for host "redacted", user "admin", database "postgres", SSL off".

I am connecting using PGAdmin.

I can connect using other accounts which i set up which are not super user accounts.

Can anyone suggest how i can resolve this.

Thanks,

Jodie

Jodie
asked 6 months ago282 views
1 Answer
0

Hello,

Please note, when the rds.force_ssl=1 feature is active on your DB instance, connection attempts that aren't using SSL are rejected with the following message:

$ psql -h db-name.555555555555.ap-southeast-1.rds.amazonaws.com port=5432 dbname=testDB user=testuser

Error: psql: error: FATAL: no pg_hba.conf entry for host "w.x.y.z", user "testuser", database "testDB", SSL off

Can you please try to set sslmode=allow (default is prefer) in PGAdmin tool and see if it works. I am assuming you have set rds.force_ssl=1 in RDS instance parameter group [1].

Reference

[1] https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Concepts.General.SSL.html#PostgreSQL.Concepts.General.SSL.Requiring : Using SSL with a PostgreSQL DB instance - Requiring an SSL connection to a PostgreSQL DB instance

Hope it helps and if it does, I would appreciate if answer can be accepted so that community can benefit for clarity when searching for similar issues/queries in repost.

Thank you!

AWS
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions