By kaushalyap
Goal is to avoid Error: self signed certificate in certificate chain or disabling it by setting Node env.
I do not think copying content from ${_self.CA_CERT} env to file and uploading it to repository and referring it as file approach sounds safe. There is support page describing saving it using script and referring it at runtime, I tried it like
DATABASE_URL=${self.DATABASE_URL}&sslrootcert=/workspace/ca_cert.cert
even tried setting NODE_EXTRA_CA_CERTS
I am using Postgraphile as middleware in my case, trying to connect to dev database.
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!
I was able to fix this in Postgraphile by using Pool from pg
export const pool = new Pool({
user: process.env.DB_USERNAME,
host: process.env.DB_HOSTNAME,
database: process.env.DATABASE,
password: process.env.DB_PASSWORD,
port: Number(process.env.DB_PORT),
ssl: {
rejectUnauthorized: true,
ca: process.env.CA_CERT,
},
})
and passing pool object postgraphile
const middleware = postgraphile(db, schemas, options)
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.