I'm getting a 403 FORBIDDEN error and need to set the TLS version to TLS v1.2
with fetch calls using the node-fetch
library. How do I do that?
How do I use a specific TLS version with `node-fetch` like TLS v1.2?
Asked Answered
I figured it out:
You can use the tls
library to do it.
const tls = require('tls');
tls.DEFAULT_MIN_VERSION = 'TLSv1.2';
const response = await fetch(...);
...
© 2022 - 2024 — McMap. All rights reserved.