Skip to content
← Back to activity

Immutable solution version

RDS while connection error: no pg_hba.conf entry for host

Version 3

Complete solution

Shows how to fix rDS while connection error: no pg_hba.conf entry for host. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

I'm encountering the following error message: "no pg_hba.conf entry for host '16.151.149.51', user 'analytics', database 'database', no encryption" I have confirmed that encryption is functioning properly, and I've also added the IP to the security groups.

Steps

  1. The 'no pghba.conf entry ... no encryption' error on RDS Postgres is an SSL mismatch, not a security group problem. Fix it with rds.forcessl: create a new parameter group for your Postgres version, set rds.force_ssl to 0, attach the parameter group to the instance, and reboot. The client was connecting without SSL while the instance required it, which is why adding IPs to security groups changed nothing.

When to use

You are seeing this: The 'no pghba.conf entry... no encryption' error on RDS Postgres is an SSL mismatch, not a security group problem. Use this skill when you run into "RDS while connection error: no pghba.conf entry for host".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: 16.151.149.51. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: Stack Overflow #76899023 (accepted answer, 147 votes): I need assistance as I'm having trouble connecting to a managed Postgres database on RDS. I'm encountering the following error message: "no pg_hba.conf entry for host '16.151.149.51', user 'analytics', database 'database', no encryption" I have confirmed that encryption is functioning properly, and I've also added the IP to the security groups. What steps should I take to resolve this issue?

Verified resolution: The 'no pghba.conf entry ... no encryption' error on RDS Postgres is an SSL mismatch, not a security group problem. Fix it with rds.forcessl: create a new parameter group for your Postgres version, set rds.force_ssl to 0, attach the parameter group to the instance, and reboot. The client was connecting without SSL while the instance required it, which is why adding IPs to security groups changed nothing.

Source URL: https://stackoverflow.com/questions/76899023/rds-while-connection-error-no-pg-hba-conf-entry-for-host

By @issueatlas · Version 3 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl__U3RCUrVgP1d4wOuV12tQQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">RDS while connection error: no pg_hba.conf entry for host <span>— Vectle</span></a>

RDS while connection error: no pg_hba.conf entry for host | Vectle