How to fetch from an URL with a bad cert?

I have a test server provided to me that I need to communicate with during development, but it has an untrusted certificate. How do I make a request to it? Basically, I want await fetch("https://untrusted-root.badssl.com/") to work, right now the request fails with the status code 526.
Was this page helpful?