workerd icon indicating copy to clipboard operation
workerd copied to clipboard

🐛 Bug Report — fetch fails locally with custom port on HTTPS

Open PierBover opened this issue 1 year ago • 3 comments

I'm trying to do a fetch request from a Worker to a local dev server over HTTPS and getting a 500 error.

The URL is something like this:

https://127.0.0.1:5555/some/path/etc

Wrangler only outputs this:

[wrangler:err] Error: internal error
   at (stack trace)
[wrangler:inf] GET /some/path/etc 500 Internal Server Error (19ms)

The request works as expected when disabling HTTPS in the dev server.

This is a bit of a pain because the server needs HTTPS for other features. So now we're required to manually enable/disable HTTPS when testing a single endpoint that is called from the Worker.

I'm getting this warning from Wrangler:

WARNING: known issue with fetch() requests to custom HTTPS ports in published Workers

Which refers to published workers, and I'm testing this locally.

PierBover avatar Mar 26 '24 04:03 PierBover

According to this custom ports are supported now: https://developers.cloudflare.com/workers/configuration/compatibility-dates/#allow-specifying-a-custom-port-when-making-a-subrequest-with-the-fetch-api

But I still get that warning on local dev 🤔

ivanfgm avatar Oct 05 '24 19:10 ivanfgm

Same here @ivanfgm! Have you tried once deployed to CF network?

LilaRest avatar Oct 09 '24 14:10 LilaRest

Same here @ivanfgm! Have you tried once deployed to CF network?

Just got the chance to try on a deployed instance. Works perfectly, faultlessly, superbly, excellently, flawlessly, to perfection, without fault, ideally, impeccably, exquisitely.

ivanfgm avatar Oct 31 '24 01:10 ivanfgm

Could be related with, I wonder if anyone figured this out yet?

hasangenc0 avatar Jan 17 '25 15:01 hasangenc0