TypeError: fetch failed "UNABLE_ TO_ VERIFY_ LEAF_ SIGNATURE" when fetching my external API

Im trying to fetch some data from my external backend (node + express) in a NextJs 14.2.5 server component, but for some reason it fails in development and crashes when building to production in Vercel.

The API URL is ‘https://filehost.comidolar.com.ar:6060/api/blackmaps/mapgallery

I’ve red this is a SSL Certificate issue but I couldn’t find any solution that fixes my problem.
This is not a NextJs related issue given that I’ve tried the same with other Server Side Frameworks and i got exactly the same error.

Solved it! If you are facing this issue, in my case I solved it by adding the “ca-bundle.crt” file to my express API. I only had the certificate and the private key imported in the app and that was causing the error.

1 Like

Thanks for coming back to share your solution, @genadev!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.