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.

Hi!
I just created a new Managed Database with PostgreSQL at DigitalOcean.
Now, i’m trying to connect with node.js and i’m getting the following error:
(node:15100) UnhandledPromiseRejectionWarning: Error: self signed certificate in certificate chain
at TLSSocket.onConnectSecure (_tls_wrap.js:1321:34)
at TLSSocket.emit (events.js:210:5)
at TLSSocket._finishInit (_tls_wrap.js:794:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:608:12)
(node:15100) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15100) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Error: Connection terminated unexpectedly
at Connection.<anonymous> (C:\Users\luizh\Documents\abacate\node_modules\pg\lib\client.js:252:9)
at Object.onceWrapper (events.js:299:28)
at Connection.emit (events.js:210:5)
at Socket.<anonymous> (C:\Users\luizh\Documents\abacate\node_modules\pg\lib\connection.js:76:10)
at Socket.emit (events.js:215:7)
at TCP.<anonymous> (net.js:659:12) undefined
Error: self signed certificate in certificate chain
at TLSSocket.onConnectSecure (_tls_wrap.js:1321:34)
at TLSSocket.emit (events.js:210:5)
at TLSSocket._finishInit (_tls_wrap.js:794:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:608:12) {
code: 'SELF_SIGNED_CERT_IN_CHAIN'
} undefined
This is my code:
const connectionString = 'postgresql://doadmin:xxxx@db-cookify-do-user-6685692-0.db.ondigitalocean.com:25060/defaultdb?sslmode=require&ssl=true'
const pool = new Pool({
connectionString: connectionString,
ssl: true,
})
If i run my script with NODE_TLS_REJECT_UNAUTHORIZED=0, it works well.
Anybody can help me with this?
alex reed
4f973b49ee8845faba44b031b8ef14
3f2d6cc974094bc6a8b84055a3a7b6
44698b4d25054ea6a464f4a5215a7b
dolphinnnn
phosphide
xcco3x
Ross
Telmo Valverde
Alexandre Herlinvaux
Lukas Ulrich
72e659fde73744d381097f36c2b3ad