'Cloudflare Worker encountering 502 TLS cert issue when fetching

Is there any way to override a HTTPS fetch in Cloudflare Workers when fetching a third-party address?

I was having this issue with IBM Cloud Foundry apps issued to a specific subdomain (only some subdomains are affected). I've also previously encountered this issue with some Sentry endpoints. In both those cases, and given my use cases, it would have been okay over HTTP unencrypted. So is there a way to proceed with the fetch instead of getting 502?

FYI: In Postman, these fetches can retrieve the correct response from those end-points.

Detail on the error message:

TLS peer's certificate is not trusted; reason = unable to get local issuer certificate


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source