axios with ssl options

359 Views Asked by At

I went through axios documentation. It says to specify the ssl options in http agent options. But for each request loading the ssl from file like below have performance problem?

const httpsAgent = new https.Agent({
  rejectUnauthorized: false, // (NOTE: this will disable client verification)
  cert: fs.readFileSync("./usercert.pem"),
  key: fs.readFileSync("./key.pem"),
  passphrase: "YYY"
})

axios.get(url, { httpsAgent })
0

There are 0 best solutions below