I have a Express.js application running on DO Apps Platform. I want to attach a Managed Mongo DB component to it but the DATABASE_URL is not connecting with the App.
I am getting this error
App starting error: MongooseServerSelectionError: self signed certificate in certificate chain
I know the reason behind this. Because i am not specifying the crt file. But i don’t know how to add the crt file in the production. If i just include it in the source files wouldn’t it be a security concern?
Is there any better way to attach mongoDB component to a DO Apps?
Note: I am using Node.js and Mongoose
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!
Here’s a workaround.
ALERT: Not recommended and secured for production. Makes MITM attacks possible. Do so at your own risk.
In your NodeJS component on App Platform, add this as an environment variable
Key as: NODE_TLS_REJECT_UNAUTHORIZED and value as 0
There are safer workarounds to the above though, but for quickly prototyping, the above is fine
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.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.