fetch https 127.0.0.1 throws pages err

I have a pages function that is making a fetch request :

export const onRequest = async () =>
fetch("https://127.0.0.1")


[pages:err] GET /api/proxy: TypeError: fetch failed
    at Object.processResponse (/Users/alexander/sandbox/src/github.com/udiaca/u0.vc/node_modules/wrangler/node_modules/undici/lib/fetch/index.js:199:23)
    at /Users/alexander/sandbox/src/github.com/udiaca/u0.vc/node_modules/wrangler/node_modules/undici/lib/fetch/index.js:928:38
    at node:internal/process/task_queues:141:7
    at AsyncResource.runInAsyncScope (node:async_hooks:202:9)
    at AsyncResource.runMicrotask (node:internal/process/task_queues:138:8)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[pages:err] Cause: Error: unable to verify the first certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1532:34)
    at TLSSocket.emit (node:events:527:28)
    at TLSSocket.emit (node:domain:475:12)
    at TLSSocket._finishInit (node:_tls_wrap:946:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:727:12)
    at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17)


My localhost https server certs were installed using https://github.com/FiloSottile/mkcert
mkcert -install
mkcert localhost 127.0.0.1 ::1


I have verified that the server is working using firefox, chrome, and curl.

How can I get my pages function to recognize these certificates?
GitHub
A simple zero-config tool to make locally trusted development certificates with any names you'd like. - GitHub - FiloSottile/mkcert: A simple zero-config tool to make locally trusted develo...
Was this page helpful?