add support for loading CA bundles

fix loop

typo

another typo *sigh*

this wasn't doing what I thought it was doing.
This commit is contained in:
Niall O'Higgins 2012-02-27 15:45:43 -08:00 committed by indexzero
parent 2c3650746c
commit 10f6b05775

View File

@ -45,11 +45,21 @@ if (argv.config) {
}
//
// If `config.https` is set, then load those files into the config options.
// If `config.https` is set, then load the required file contents into the config options.
//
if (config.https) {
Object.keys(config.https).forEach(function (key) {
// If CA certs are specified, load those too.
if (key === "ca") {
for (var i=0; i < config.https.ca.length; i++) {
if (config.https.ca === undefined) {
config.https.ca = [];
}
config.https.ca[i] = fs.readFileSync(config.https[key][i], 'utf8');
}
} else {
config.https[key] = fs.readFileSync(config.https[key], 'utf8');
}
});
}