diff --git a/test/parallel/test-tls-cert-chains-in-ca.js b/test/parallel/test-tls-cert-chains-in-ca.js index 69f62c3f72..3b4e78919f 100644 --- a/test/parallel/test-tls-cert-chains-in-ca.js +++ b/test/parallel/test-tls-cert-chains-in-ca.js @@ -12,8 +12,7 @@ const { // agent6-cert.pem includes cert for agent6 and ca3, split it apart and // provide ca3 in the .ca property. -const agent6Chain = keys.agent6.cert.split('-----END CERTIFICATE-----') - .map((c) => { return c + '-----END CERTIFICATE-----'; }); +const agent6Chain = keys.agent6.cert.split(/(?=-----BEGIN CERTIFICATE-----)/); const agent6End = agent6Chain[0]; const agent6Middle = agent6Chain[1]; connect({