Skip to content

fetch() SSL disable certificate validation #44038

Answered by KhafraDev
marek-benes asked this question in General
Discussion options

You must be logged in to vote

Using the built in fetch with undici, you can do

import { Agent, setGlobalDispatcher } from 'undici'

const agent = new Agent({
  connect: {
    rejectUnauthorized: false
  }
})

setGlobalDispatcher(agent)

await fetch('...')

Replies: 5 comments 24 replies

Comment options

You must be logged in to vote
3 replies
@marek-benes
Comment options

@bnoordhuis
Comment options

@shivkumar-jirwankar
Comment options

Comment options

You must be logged in to vote
13 replies
@gusttavonl
Comment options

@Ju777
Comment options

@juinson
Comment options

@juinson
Comment options

@Taschenbuch
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@KhafraDev
Comment options

@zap-dev1
Comment options

@mherb63
Comment options

@KhafraDev
Comment options

@mherb63
Comment options

Answer selected by marek-benes
Comment options

You must be logged in to vote
2 replies
@LqdBcnAtWork
Comment options

@guscsales
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet