Skip to content

Commit

Permalink
add support for loading CA bundles
Browse files Browse the repository at this point in the history
fix loop

typo

another typo *sigh*

this wasn't doing what I thought it was doing.
  • Loading branch information
Niall O'Higgins authored and indexzero committed Mar 9, 2013
1 parent 2c36507 commit 10f6b05
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bin/node-http-proxy
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
config.https[key] = fs.readFileSync(config.https[key], 'utf8');
// 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');
}
});
}

Expand Down

0 comments on commit 10f6b05

Please sign in to comment.