Hi Team,
I am working on 7.10.0 kibana. I have created a custom plugin and after deploying it was getting ssl certificate error. To solve that i had installed "ssl-root-cas" using this package I am adding required certificate and create httpsAgent and use it in my apis as shown below.
var rootCas = require('ssl-root-cas').create();
rootCas.addFile(certificatepath);
require('https').globalAgent.options.ca = rootCas;
const https = require('https');
const http = require('http');
const httpsAgent = useHttps ? new https.Agent({
rejectUnauthorized: true,
ca: rootCas
}) : new http.Agent({});
When I test the app locally it works fine, but after creating build and installing the plugin, it gives error - "Error: Cannot find module 'ssl-root-cas'"
below is my package.json file.
{
"name": "correlationapp",
"version": "7.10.0",
"private": true,
"scripts": {
"build": "yarn plugin-helpers build",
"plugin-helpers": "node ../../scripts/plugin_helpers",
"kbn": "node ../../scripts/kbn"
},
"dependencies": {
"moment": "^2.24.0",
"ssl-root-cas": "^1.3.1"
}
}
Regards
Praveer.