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.

Hello DigitalOcean Support Team,
I am experiencing a persistent issue connecting my Bun/Elysia backend application, deployed on the DigitalOcean App Platform, to my Managed PostgreSQL Database.
The application successfully builds and deploys, but any attempt to connect to the database (specifically during the sign-in/login route when a query is executed) fails with a security error.
The application logs repeatedly show the following error, which originates from the pg-pool layer of the database driver:
error: self signed certificate in certificate chain
code: "SELF_SIGNED_CERT_IN_CHAIN"
Based on your documentation and standard PostgreSQL practice, I have already attempted the following solutions, but the error remains:
SSL Configuration in Code: Explicitly setting rejectUnauthorized: false within the database connection pool configuration (src/db/client.ts).
Environment Variable Override: Setting the global environment variable NODE_TLS_REJECT_UNAUTHORIZED=0 in the App Platform settings.
Connection String Override: Appending the parameters ?sslmode=require&rejectUnauthorized=0 directly to the DATABASE_URL environment variable.
CA Certificate Injection: I attempted to pass the downloaded CA certificate string to the driver’s ssl.ca property (both directly and encoded in Base64), but this also failed to resolve the chain validation error.
Since all application-level solutions have failed, it suggests the issue may be related to the way the PgBouncer (the connection pooler) is configured on the Managed Database side, or a specific requirement for the trusted certificate chain that is not being satisfied in the App Platform environment.
Could you please assist in troubleshooting the PostgreSQL connection? Specifically, I need to know:
Is there a unique method for passing the required SSL configuration when connecting from a DigitalOcean App to a Managed Database?
Are there any firewall rules or specific CA chain details that might be missing from the standard environment?
Thank you for your prompt attention to this critical issue.
Best regards,
Renaldy Sousa / renaldy.sousa@gmail.com
a0aa4c11068a4e98bc3cde06ce6c8c
4d49e500a0484b1a84a7f10bed8d22
modozo.tech
santoshpatil
Aspiresoftserv
Maria Millar
sunil2197
Lukas Ulrich
36d56192d3114513857618b22686be
ISMAIL JAMIL
Lumin De Silva
Musharraf