SAP-BTP-Spielwiese/app1/node_modules/@sap/xsenv/lib/cacert.js
Markus Rettig 775ac7b58c completed step 3 from the tutorial
you must login with an BTP account in order to see the app
2024-02-08 16:13:36 +01:00

27 lines
716 B
JavaScript

'use strict';
var debug = require('debug')('xsenv');
var path = require('path');
var fs = require('fs');
var assert = require('assert');
var VError = require('verror');
exports.loadCertificates = loadCertificates;
function loadCertificates(certPath) {
assert(!certPath || typeof certPath === 'string', 'certPath argument should be a string');
certPath = certPath || process.env.XS_CACERT_PATH;
if (certPath) {
debug('Loading certificate(s) %s', certPath);
try {
return certPath
.split(path.delimiter)
.map(function (f) {
return fs.readFileSync(f);
});
} catch (err) {
throw new VError(err, 'Could not load certificate(s) ' + certPath);
}
}
}