cloudflare / workerd

The JavaScript / Wasm runtime that powers Cloudflare Workers
https://blog.cloudflare.com/workerd-open-source-workers-runtime/
Apache License 2.0
6.19k stars 296 forks source link

🐛 Bug Report — allow_custom_ports is not working #2955

Open ceddybi opened 1 day ago

ceddybi commented 1 day ago

According to allow-specifying-a-custom-port-when-making-a-subrequest-with-the-fetch-api

it says that setting the flag allow_custom_ports or a compatibility date greater than 2024-09-02, should allow fetch to work with custom ports for HTTPS, however settings this has no effect, you still get the warning and the api errors out

known issue with fetch() requests to custom HTTPS ports in published Workers: the custom port will be ignored when the Worker is published using the "wrangler deploy" command.

ceddybi commented 1 day ago

@danlapid

danlapid commented 1 day ago

Is the problem you’re having just the error message or is the functionality not working as intended in a deployed worker?

ceddybi commented 1 day ago

@danlapid i haven't deployed it yet, i'm trying in dev using --remote, and the fetch request don't work, it gets stuck shows an error, looks like maybe the port is removed

danlapid commented 1 day ago

Seems like we might’ve missed that then, it should work in local dev without the —remote flag and in a deployed worker

ceddybi commented 1 day ago

@danlapid it's actually working, i logged the request

the real issue is i'm getting 526 (invalid certificate), my app wasn't checking for this status code, that's why it was stuck

but i had set process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' to allow invalid certifications, looks like it's not working, how do you disable the invalid certificates in cloudflare fetch?

ceddybi commented 1 day ago

Seems like we might’ve missed that then, it should work in local dev without the —remote flag and in a deployed worker

Looks like without --remote i don't even get the 526, it fails entirely, but when i add the flag i get status 526