Skip to content

Commit

Permalink
Added optional support for allowing unauthorized TLS/SSL certificate …
Browse files Browse the repository at this point in the history
…requests in runtimes which support it.
  • Loading branch information
coreybutler committed Sep 13, 2022
1 parent 9cab271 commit 1c7f117
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/fetch/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ export default function Fetch (resource, init = {}) {
delete init.signal

const net = (resource.protocol === 'https:' ? https : http)
if (resource.protocol === 'https' && init.rejectUnauthorized === false && !init.hasOwnProperty('agent')) {
init.agent = new net.Agent({
rejectUnauthorized: false
})
}

const req = net.request(resource.href, init, res => {
let body = ''

Expand Down

0 comments on commit 1c7f117

Please sign in to comment.