Connecting to a local https server from wrangler pages dev on windows.

I have a pages project with a function that makes a fetch request to another service. Locally this is running on https://localhost:9002. Notice it's using TLS, and it has a self-signed certificate, outside of my control. When I try to run wrangler pages dev I get an error rather than the expected response from the other service:
workerd/jsg/util.c++:275: error: e = kj/compat/tls.c++:221: failed: TLS peer's certificate is not trusted; reason = unable to get local issuer certificate
stack: 7ff699735100 7ff69977895c 0 0 0 7ff699ab4a48 7ff699ab58eb 7ff699ab7c18 0 0 0 7ff699a3938d 0 0; sentryErrorContext = jsgInternalError
workerd/jsg/util.c++:275: error: e = kj/compat/tls.c++:221: failed: TLS peer's certificate is not trusted; reason = unable to get local issuer certificate
stack: 7ff699735100 7ff69977895c 0 0 0 7ff699ab4a48 7ff699ab58eb 7ff699ab7c18 0 0 0 7ff699a3938d 0 0; sentryErrorContext = jsgInternalError
I have tried to run With several combinations of NODE_EXTRA_CA_CERTS, SSL_CERT_FILE and NODE_TLS_REJECT_UNAUTHORIZED=0 but without any luck. Anything I could try to make this work?
5 Replies
clueed
clueed8mo ago
Same here but for workers. For me, it works when running natively (on mac) but inside of docker I get the same error. As far as I can tell, you can't fetch any https urls.
clueed
clueed8mo ago
Here is a relevant issue but it's rather stale and supposedly fixed. https://github.com/cloudflare/workers-sdk/issues/3264
GitHub
🐛 BUG: Wrangler dev fails to fetch() · Issue #3264 · cloudflare/wor...
Which Cloudflare product(s) does this pertain to? Wrangler What version of Wrangler are you using? 3.0.0 What operating system are you using? Windows 10 Describe the Bug After updating to the lates...
Marius Gundersen
That issue claims that it has been fixed, but it doesn't appear to be.
Cyb3r-Jak3
Cyb3r-Jak38mo ago
That issue was different than what you are dealing with. Probably best to make a new issue
Marius Gundersen
GitHub
🐛 BUG: fetch cannot connect to local https server with self signed ...
Which Cloudflare product(s) does this pertain to? Pages What version(s) of the tool(s) are you using? 3.7.0 [Wrangler] What version of Node are you using? 18.13.0 What operating system are you usin...