Hi, hope someone can help me. Im trying to deploy my strapi app but I keep getting the same error.
08:25:43] (node:27) [DEP0040] DeprecationWarning: The punycode
module is deprecated. Please use a userland alternative instead.
[backend-manueloroscohome] [2025-01-20 08:25:43] (Use node --trace-deprecation ...
to show where the warning was created)
[backend-manueloroscohome] [2025-01-20 08:25:44] [2025-01-20 08:25:44.711] error: self-signed certificate in certificate chain
[backend-manueloroscohome] [2025-01-20 08:25:44] Error: self-signed certificate in certificate chain
[backend-manueloroscohome] [2025-01-20 08:25:44] at TLSSocket.onConnectSecure (node:_tls_wrap:1679:34)
[backend-manueloroscohome] [2025-01-20 08:25:44] at TLSSocket.emit (node:events:520:28)
[backend-manueloroscohome] [2025-01-20 08:25:44] at TLSSocket.emit (node:domain:488:12)
[backend-manueloroscohome] [2025-01-20 08:25:44] at TLSSocket._finishInit (node:_tls_wrap:1078:8)
[backend-manueloroscohome] [2025-01-20 08:25:44] at ssl.onhandshakedone (node:_tls_wrap:864:12)
this is my config/env/databse.ts file module.exports = ({ env }) => ({ connection: { client: ‘postgres’, connection: { connectionString: env(‘DATABASE_URL’), ssl: env.bool(‘DATABASE_SSL’, false) && { ca: env(‘DATABASE_CA’) ? env(‘DATABASE_CA’).toString() : undefined, rejectUnauthorized: env.bool(‘DATABASE_SSL_REJECT_UNAUTHORIZED’, false), }, }, pool: { min: env.int(‘DATABASE_POOL_MIN’, 2), max: env.int(‘DATABASE_POOL_MAX’, 10) }, debug: false, }, });
Im still getting the same error. enc variables are
APP_URL=${APP_URL} NODE_ENV=production DATABASE_CA=${db-name.CA_CERT} DATABASE_SSL_REJECT_UNAUTHORIZED=false DATABASE_POOL_MIN=2 DATABASE_POOL_MAX=10 DATABASE_SSL=false
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!
Heya,
The error self-signed certificate in certificate chain
occurs because Strapi (or Node.js) is trying to validate a certificate, but it does not trust the self-signed certificate in the chain. This is related to how your app is connecting to your managed PostgreSQL database. Let’s address this step by step. What I can see on a first glance are a couple of things
SSL Configuration:
ssl
configuration is not properly aligned. If your database uses SSL but has a self-signed certificate, you need to set rejectUnauthorized: false
explicitly and handle the certificate correctly.Environment Variables:
DATABASE_CA
seems to point to ${db-name.CA_CERT}
. If it’s not correctly defined in your App Platform settings, it might be causing issues.Strapi Database Configuration:
database.ts
file may not correctly handle SSL when DATABASE_SSL
is false
.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.