I am trying to learn how to use AWS RDS. I am running across this error when connecting:
Error invoking remote method ‘DB_CONNECT’: error: no pg_hba.conf entry for host "EXAMPLE IP HERE", user "EXAMPLE USER HERE", database "EXAMPLE DATABASE NAME HERE", no encryption.
This database is using the free tier and will be for my personal project.
I tried:
- Changing security groups to allow my IP address as well as
:://0
and0.0.0.0
- Remaking the database in general
- Looking it up
2
Answers
Based on error I am assuming you are running RDS Postgres. Are you trying to connect to the database over internet ( I believe so since you mentioned security group opened for 0.0.0.0/0)
Did you select Public access under connectivity ? Otherwise RDS Amazon RDS doesn’t assign a public IP address to the database.
This may help you configure public access if needed
https://repost.aws/knowledge-center/rds-connectivity-instance-subnet-vpc
If you had set rds.force_ssl to 1 in parameter group, you must connect using psql (for example) as below
psql -h $RDSHOST "user=xxx dbname= sslmode=require"
As per Securing connections to RDS for PostgreSQL with SSL/TLS – Amazon Relational Database Service, it is recommended that you use Secure Socket Layer (SSL) encryption when connecting to the database.
The error message you are receiving indicates that your SQL client connection is not using SSL ("
no encryption
").If you activate SSL for your connection, it should be able to connect.