mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Removing ssl-root-cas dep
This commit is contained in:
parent
5ab7cd18bd
commit
63740c6807
2 changed files with 5 additions and 11 deletions
|
@ -56,8 +56,7 @@
|
|||
"request": "^2.40.0",
|
||||
"requirefrom": "^0.2.0",
|
||||
"semver": "^4.2.0",
|
||||
"serve-favicon": "~2.2.0",
|
||||
"ssl-root-cas": "^1.1.7"
|
||||
"serve-favicon": "~2.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"connect": "~2.19.5",
|
||||
|
|
|
@ -12,14 +12,9 @@ var join = require('path').join;
|
|||
|
||||
// If the target is backed by an SSL and a CA is provided via the config
|
||||
// then we need to inject the CA
|
||||
var hasCustomCA = false;
|
||||
var customCA;
|
||||
if (/^https/.test(target.protocol) && config.kibana.ca) {
|
||||
var sslRootCAs = require('ssl-root-cas/latest');
|
||||
sslRootCAs.inject();
|
||||
var ca = fs.readFileSync(config.kibana.ca, 'utf8');
|
||||
var https = require('https');
|
||||
https.globalAgent.options.ca.push(ca);
|
||||
hasCustomCA = true;
|
||||
customCA = fs.readFileSync(config.kibana.ca, 'utf8');
|
||||
}
|
||||
|
||||
// Create the router
|
||||
|
@ -59,8 +54,8 @@ router.use(function (req, res, next) {
|
|||
options.headers['x-forward-proto'] = req.connection.pair ? 'https' : 'http';
|
||||
|
||||
// If the server has a custom CA we need to add it to the agent options
|
||||
if (hasCustomCA) {
|
||||
options.agentOptions = { ca: https.globalAgent.options.ca };
|
||||
if (customCA) {
|
||||
options.agentOptions = { ca: [customCA] };
|
||||
}
|
||||
|
||||
// Only send the body if it's a PATCH, PUT, or POST
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue