Postgres SSL cerificat

i’m using postgres like a SGBD for my backend, and i deployed my project to production in a ubuntu server, and it worked fine but when i wanna enable ssl in postgres after that i have this screen

logs

.env file
DATABASE_URL=postgres:db:port/postgres?sslca=/etc/ssl/postgresql.crt&sslmode=require
NODE_ENV=production
DATABASE_SSL=true

the postgresql.crt file i get it from scalegrid

and if i add this line in the .env the app work again DATABASE_REJECT_UNAUTHORIZED=false
but i know that is not recommended for production environment

so the question is where can i find the root and the ca certificate

Hi @Omar_OUKIL,

The way authentication is made between your server and your database depends on how the database is hosted/managed. To avoid a self-signed certificate, please refer to your database provider about how to obtain the certificates.

Regards

1 Like