Docker container running on an ec2 instance cant connect to RDS AWS

0

I can access the RDS by ssh-ing into the EC2 instance, and passing the url and password to psql.

When I try to access the RDS via the docker container running on the EC2 using the same url and password I get the following output.

14:05:57.710 [error] Postgrex.Protocol (#PID<0.162.0>) failed to connect: ** (Postgrex.Error) FATAL 28000 (invalid_authorization_specification) no pg_hba.conf entry for host "144.44.44.444", user "postgres", database "postgres", no encryption

Note: I replaced the host IP with a random value above.

2 Answers
1

Hello.

I think it's probably RDS PostgreSQL, but I think it can be resolved by setting the "rds.force_ssl" parameter in the RDS parameter group to 0, or by downloading the certificate described in the document below into the container and using it when connecting.
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html

profile picture
EXPERT
answered 3 months ago
profile picture
EXPERT
A_J
reviewed 3 months ago
  • Thanks for this. In this case it was related to not setting ssl: true in the runtime.exs file.

0
Accepted Answer

This was resolved by setting ssl: true int the runtime.exs file.

awstas
answered 3 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