Question
How to add SSL certificate to App Platform environment variables in order to connect to Managed Database
The current code I have set up works fine, but it is not secure.
const { Pool } = require('pg')
const pgPool = new Pool({
user: process.env.PGUSER,
password: process.env.PGPASSWORD,
host: process.env.PGHOST,
database: process.env.PGDATABASE,
port: process.env.PGPORT,
ssl: {
rejectUnauthorized: false
},
})
What I would like the ssl object to look like is this.
ssl: {
rejectUnauthorized: true,
ca: process.env.CACERT,
},
Unfortunately I am having trouble figuring out how to put make the certificate available to my app.I would prefer not to commit the certificate to my source control..
Thanks,
Peter
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.
×