Closed DJDaveMark closed 12 months ago
Do you have any examples of using HTTPS while supplying certificates?
I found an example using the https node module, but I'd like to use o.js to avoid crafting the odata URLs manually.
https
o.js
const https = require("https"); const fs = require("fs"); const requestParams = { hostname: "<the hostname>", port: 44300, key: fs.readFileSync("path/to/client-key.pem"), cert: fs.readFileSync("path/to/client-crt.pem"), ca: fs.readFileSync("path/to/ca-crt.pem"), rejectUnauthorized : false, path: "<the OData URL>", method: "<GET/POST/DELETE etc>" }; const httpsReq = https.request(requestParams, httpsRes => { // Handle the response here }); httpsReq.end();
I got an answer over on Stack Overflow: https://stackoverflow.com/a/75745957/344029
Do you have any examples of using HTTPS while supplying certificates?
I found an example using the
https
node module, but I'd like to useo.js
to avoid crafting the odata URLs manually.