Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

By Jus N
Wormy
I had trouble connecting to digitalocean database in node js and was getting errors such as:
Error: self signed certificate in certificate chain.
or
error: no pg_hba.conf entry for host "x.x.x.x", user "------", database "------", SSL off
but then I added ca-certificate.crt file into my node.js app newly created ssl folder and wrote this
const pg = require('pg')
const fs = require('fs')
const pool = new pg.Pool({
user: "-----",
password: "--------",
host: "-----------",
port: 25060,
database: "----",
ssl: true,
ssl: {
ca: fs.readFileSync('../ssl/ca-certificate.crt'),
rejectUnauthorized: true,
}
module.exports = pool;
This line fixed all those errors and now I can connect to the database
ca: fs.readFileSync('../ssl/ca-certificate.crt'),
but I feel it’s not very common practice to have ca-certificate.crt file in my app folder so I would like to know how to handle this?
Aakash Singh
Aakash Singh
Frank Tufano
fullammo
4ae272398ee6445a9bf73f4cd632b5
eddie
Taha Aziz Ben Ali
Telmo Valverde
Alexandre Herlinvaux
52d4eff26a544eefb189e2005836b2