1

Is there an equivalent of curl -k option in axios? when i am calling api with curl -k it is working perfectly fine but if i am using it via axios code in node js it gives ssl chain certificate issue.

James Z
  • 12,209
  • 10
  • 24
  • 44
Nirmesh
  • 305
  • 5
  • 12

1 Answers1

0

I believe you can use a HTTPS agent to ignore SSL errors like so:

const instance = axios.create({
  httpsAgent: new https.Agent({  
    rejectUnauthorized: false
  })
});
Conor Reid
  • 578
  • 3
  • 16