Increase max buffer for readMacCaCertificates

Node 12 increases this limit to 1mb

Longer term fix would be to use spawn instead of exec
This commit is contained in:
Matt Bierner 2019-04-24 16:03:30 -07:00
parent 6164a77e36
commit a8fe4ffee6

View file

@ -481,7 +481,7 @@ function readWindowsCaCertificates() {
}
async function readMacCaCertificates() {
const stdout = (await promisify(cp.execFile)('/usr/bin/security', ['find-certificate', '-a', '-p'], { encoding: 'utf8' })).stdout;
const stdout = (await promisify(cp.execFile)('/usr/bin/security', ['find-certificate', '-a', '-p'], { encoding: 'utf8', maxBuffer: 1024 * 1024 })).stdout;
const seen = {};
const certs = stdout.split(/(?=-----BEGIN CERTIFICATE-----)/g)
.filter(pem => !!pem.length && !seen[pem] && (seen[pem] = true));