workers-sdk
workers-sdk copied to clipboard
fetch throws error when run locally
If I run npx wrangler dev and have fetch(url) in some script, it fails with following error: workerd/jsg/util.c++:281: error: e = kj/compat/tls.c++:221: failed: TLS peer's certificate is not trusted; reason = unable to get local issuer certificate
Hey! 👋 Are you trying to send a request to a server using a self-signed certificate? If so, you'll need to set the NODE_EXTRA_CA_CERTS environment variable to point to your certificate so it gets trusted. Alternatively, if you're using Cloudflare WARP, make sure you've set this variable to point to the Cloudflare certificate.
I don't know anything that I should create self-signed certificate. The documentation is silent about this. Why doesn't it work without any extra settings as in Node?
What is the URL of the website you're trying to fetch()?
@step135 - please could you create a reproduction that we can run locally to diagnose the problem?
hi @step135 :) we haven't heard from you in a while, so we’re going to close this issue for now, but if this is still a problem, please feel free to open a new issue referencing this one. please be sure to include an updated summary and a reproduction and we will revisit and investigate further. thanks!