Express node-fetch error

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domains are: zamon.uz, spa.zamon.uz and zamon.al-electronics.uz

I have an express nodejs server which needs to send api request on zamon.al-electronics.uz everytime it is being accessed by zamon.uz domain. I use node-fetch to make an API call, but there is something wrong with my ssl certificate. i found this solution on reddit saying:

This issue is often caused when the server doesn't serve up the full cert chain. Browsers automatically resolve it, but Node does not.

So the question is what is wrong with my ssl certificate? What should I do to get a so called "full cert chain"? Btw, I've already reached my limit of 5 requests per week...
Any help would be appreciated

My web server is (include version): nginx 1.18.0

The operating system my web server runs on is (include version): Ubuntu 20.04 LTS

My hosting provider, if applicable, is: self-hosted

I can login to a root shell on my machine (yes or no, or I don't know): yes

The version of my client is: 1.17.0

How and why did you manage to get that? :thinking:

Anyway, your host zamon.al-electronics.uz is already serving a valid certificate chain, so nothing can be improved there. The same goes for zamon.uz.

Please provide us with a detailed error log of the issue.

1 Like

I tried to fix the issue and launched certbot again and again, as a result I reached a limit for zamon.uz :pensive:

I transfered my servers (that are stored on the same host) to my self-hosted server.

Detailed error log:

Iyl 27 21:33:47 zamonuz node[143423]: (node:143423) UnhandledPromiseRejectionWarning: FetchError: request to https://zamon.al-electronics.uz/api/v2/wea-cur failed, reason: unable to verify the first certificate
Iyl 27 21:33:47 zamonuz node[143423]:     at ClientRequest.<anonymous> (/home/user/zamon-vue/_work/zamon-vue/zamon-vue/node_modules/node-fetch/lib/index.js:1461:11)
Iyl 27 21:33:47 zamonuz node[143423]:     at ClientRequest.emit (events.js:198:13)
Iyl 27 21:33:47 zamonuz node[143423]:     at TLSSocket.socketErrorListener (_http_client.js:401:9)
Iyl 27 21:33:47 zamonuz node[143423]:     at TLSSocket.emit (events.js:198:13)
Iyl 27 21:33:47 zamonuz node[143423]:     at emitErrorNT (internal/streams/destroy.js:91:8)
Iyl 27 21:33:47 zamonuz node[143423]:     at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)

UPDATE:
Well, I truly don't know what happened but now everything is working fine as before.... However, I still get that error below, although it does not affect on a website work, I would like to know why is this happening. And again any explanations and workarounds would be appreciated :slightly_smiling_face:

Weird, as there is nothing wrong with that host. See for yourself at:

https://www.ssllabs.com/ssltest/analyze.html?d=zamon.al-electronics.uz&hideResults=on

This sounds like a NodeJS problem, perhaps it doesn't have a proper root certificate store present? But I don't have any experience with NodeJS and I want to keep it that way :roll_eyes:, so maybe someone else can chip in here?

1 Like

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