gautamsi / ews-javascript-api

EWS API for TypeScript/JavaScript - ported from OfficeDev/ews-managed-api - node, cordova, meteor, Ionic, Electron, Outlook Add-Ins
MIT License
281 stars 72 forks source link

Specify certificate authority while sending request #421

Closed DarkSector closed 1 year ago

DarkSector commented 1 year ago

I would like to mimic this process. How can we specify CA certs when sending requests?

const https = require('https');
const { cacerts } = require('./local-ca-certs');

https.get(
  {
    hostname: 'example.internal',
    ca: cacerts,
  },
  (res) => {
    // do something with res
  }
);

npm set config ca ./local-ca-certs doesn't work. In the absence of local certs I encounter unable to get local issuer certificate

gautamsi commented 1 year ago

have you seen or tried this? https://stackoverflow.com/questions/29283040/how-to-add-custom-certificate-authority-ca-to-nodejs

DarkSector commented 1 year ago

Yes! That worked. Thank you. I am going to eventually have to figure out how to bundle certs with the script when I am building for electron.