mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
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:
parent
2c3650746c
commit
10f6b05775
@ -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');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user