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

5 messages · Page 1 of 1 (latest)

spring pulsar
#

Hi, I'm trying to use a fetch request in a worker to access a site with a self-signed certificate. In Node.js, I can set the environment variable 'NODE_TLS_REJECT_UNAUTHORIZED' to 0 to get data, but it doesn't seem to work in a worker. Is there any way to make it possible to retrieve data from the destination site? P.S. I don't own the destination site.

dusty flax
#

No, you are undermining the security of TLS by disabling certificate validation.

spring pulsar
#

i know it but the certificate is valid. I can access that site from my browser with out any issue or warning.

dusty flax
#

how can it be valid if it's self signed?

spring pulsar
#

I'm not sure if it's a self-signed certificate. All I know is that I can access the site in my browser. However, when I use a fetch request to retrieve JSON data from a worker, it throws an error: 'Failed: TLS peer's certificate is not trusted; reason = unable to get local issuer certificate.' In Node.js, it works when I set 'NODE_TLS_REJECT_UNAUTHORIZED.