mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
Previous code passed the index parameter from lodash.map to readFileSync, so it was essentially the same thing as: ``` map(config.get('server.ssl.certificateAuthorities'), (file, index) => { return readFileSync(file, index); }) ``` The upgrade to node8 seems to change the behavior and this was causing an error: ``` FATAL TypeError: "options" must be a string or an object, got number instead. at getOptions (fs.js:75:11) at fs.readFileSync (fs.js:549:13) at server.connection._extends.tls.ca.config.get.map (/Users/tsullivan/code/kibana/src/server/http/setup_connection.js:43:76) at Array.map (<anonymous>) at KbnServer.exports.default (/Users/tsullivan/code/kibana/src/server/http/setup_connection.js:43:59) at KbnServer.mixin (/Users/tsullivan/code/kibana/src/server/kbn_server.js:97:16) at KbnServer.exports.default (/Users/tsullivan/code/kibana/src/server/http/index.js:20:19) at KbnServer.mixin (/Users/tsullivan/code/kibana/src/server/kbn_server.js:97:16) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) at Function.Module.runMain (module.js:686:11) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3 optimizer crashed with status code 1 ``` This PR fixes the issue by making the mapping through the certificateAuthorities files with a more explicit handling of the map items, as well as remove the unnecessary lodash import
This commit is contained in:
parent
c9543b7456
commit
a5741dfbf3
1 changed files with 1 additions and 2 deletions
|
@ -1,5 +1,4 @@
|
|||
import { readFileSync } from 'fs';
|
||||
import { map } from 'lodash';
|
||||
import secureOptions from './secure_options';
|
||||
|
||||
export default function (kbnServer, server, config) {
|
||||
|
@ -41,7 +40,7 @@ export default function (kbnServer, server, config) {
|
|||
tls: {
|
||||
key: readFileSync(config.get('server.ssl.key')),
|
||||
cert: readFileSync(config.get('server.ssl.certificate')),
|
||||
ca: map(config.get('server.ssl.certificateAuthorities'), readFileSync),
|
||||
ca: config.get('server.ssl.certificateAuthorities').map(ca => readFileSync(ca, 'utf8')),
|
||||
passphrase: config.get('server.ssl.keyPassphrase'),
|
||||
|
||||
ciphers: config.get('server.ssl.cipherSuites').join(':'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue