wrangler dev - fetch() trust self signed certificates
Hello, i am using wrangler in a docker container in an local environment. i want to act the worker as a proxy, as i do in production. When i try to fetch() from another docker container, which itself puts out a self signed certificate, i get the error "failed: TLS peer's certificate is not trusted; reason = self signed certificate". Is there a chance to tell wrangler, to accept self signed certificates?
3 Replies
try disabling ssl verification in your function's code:
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0;
Hey! 👋 Wrangler should respect the
NODE_EXTRA_CA_CERTS
environment variable (https://nodejs.org/api/cli.html#node_extra_ca_certsfile), adding your self-signed certificate there should fix the issue.Thanks MrBBot, that works :)