📜  如何忽略 SSL 问题 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:33.847000             🧑  作者: Mango

代码示例1
// At instance level
const instance = axios.create({
  httpsAgent: new https.Agent({  
    rejectUnauthorized: false
  })
});
instance.get('https://something.com/foo');

// At request level
const agent = new https.Agent({  
  rejectUnauthorized: false
});
axios.get('https://something.com/foo', { httpsAgent: agent });