Error: self-signed certificate with Better Auth and TypeORM on Railway

ikkyuzaa
FREE

18 days ago

Hi Railway Team,

I'm a developer working on a Nest.js project using Better Auth and TypeORM, deployed on Railway.

I'm facing a persistent self-signed certificate in certificate chain error.

Here's what I've done so far:

  1. I found a solution in the community using ssl: { rejectUnauthorized: false } for my TypeORM connection, which resolves the issue temporarily.

  2. However, for a production-like environment, I'm trying to find the proper way to handle this. I understand that Railway's internal Postgres databases use self-signed certificates.

My question is:

What is the recommended best practice for a Node.js/TypeORM application to trust Railway's internal certificates in a production environment?

Do you have a Root CA certificate file that I can add to my project, or is there a specific method I should be using to configure my application to trust the certificates without disabling SSL validation?

Any guidance on this would be greatly appreciated.

Thank you,

Rachata Lekkeaw

Solved

2 Replies

Railway
BOT

18 days ago


parmstar
EMPLOYEE

16 days ago

The solution is to configure the application to trust Railway's internal certificates without disabling SSL validation. This can be done by obtaining the Root CA certificate from Railway or configuring the application to trust the self-signed certificates used by Railway's internal Postgres databases.


Status changed to Awaiting User Response Railway 16 days ago


Status changed to Solved parmstar 16 days ago


Error: self-signed certificate with Better Auth and TypeORM on Railway - Railway Help Station