nodejs/undici

Unprecise error message on fetch() to an endpoint with a certificate which was signed by an "unkown" CA

Fermée

#2 199 ouverte le 28 juil. 2023

 (5 commentaires) (0 réaction) (0 personne assignée)JavaScript (444 forks)batch import
enhancementgood first issue

Métriques du dépôt

Stars
 (5 319 étoiles)
Métriques de merge PR
 (Merge moyen 2j 10h) (82 PRs mergées en 30 j)

Description

Bug Description

There is a unprecise error message ("fetch failed") on fetch() to an endpoint with a certificate which was signed by an "unkown" CA. If its an custom or internal CA, the fetch() will fail, that seems correct, but the error message ist absolut unprecise. It is therefore very difficult to find the cause.

Reproducible By

fetch() to an enpoint with a certificate which was signed by an "unkown" CA.

An "unkown" CA seems to be an CA which not exist in the default search path for CAs of node. By default node seem to use CA-certificates baked in the build.

Expected Behavior

A useful error message is shown.

Logs & Screenshots

TypeError: fetch failed at Object.fetch (node:internal/deps/undici/undici:11576:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) ...

Environment

Ubuntu 22.04 Node v18.17.0

Guide contributeur