I am trying to connect to a Postgres server using Python.
import psycopg2
conn = psycopg2.connect(
host="ec2-blablabla.compute-1.amazonaws.com",
database="postgres",
user="myuser",
password="mypassword",
port = 5432,
sslmode ='prefer',
sslcompression = 0
)
cur = conn.cursor()
I get the following error:
OperationalError: SSL SYSCALL error: Connection reset by peer FATAL: no pg_hba.conf entry for host "207.100.100.100", user "myuser", database "postgres", SSL off
I am able to connect to this server from my IP using pgadmin and same ssl settings as I set in Python code. What could be the issue here?
no pg_hba.conf entry for host I cannot modify pg_hba.conf so if there is any other way, please let me know!!