Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getPEMfromConfig(config, network_config_loc) {
let result = null;
if (config) {
if (config[PEM]) {
// cert value is directly in the configuration
result = config[PEM];
} else if (config[PATH]) {
// cert value is in a file
result = readFileSync(config[PATH], network_config_loc);
result = utils.normalizeX509(result);
}
}
return result;
}