I’ve been trying for a week without success. I configured CA on my connection and it still doesn’t work. I did not include any reliable source to leave public access.
The error: error: no pg_hba.conf entry for host “**7.15.139.203”, user “xxxx”, database “xxx”, no encryption
Has anyone been through this?
const dataSource = **new** DataSource({
type: "postgres",
host: process.env.DATABASE_HOST,
port: parseInt(process.env.DATABASE_PORT, 10) || 5432,
username: process.env.DATABASE_USER,
password: process.env.DATABASE_PASSWORD,
database: process.env.DATABASE_NAME,
entities: [xxxx, xxxxx],
synchronize: false,
dropSchema: false,
logging: false,
ssl: {
ca: process.env.CA,
enableTrace: true,
rejectUnauthorized: true
}
});
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
Are you using a managed Postgres database cluster? If so, you might also want to try setting
rejectUnauthorized: false
just to test if it’s an SSL-related issue.Also, another thing that you could try is to use
Pool
frompg
instead:Let me know how it goes.
- Bobby