Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: refactor test-tls-cert-chains-in-ca
When splitting PEM string into separate certs, use non-capturing regexp
to avoid having to put the split string back with .map(). As a bonus,
this splits the PEM into two certs, rather than 2 certs and a third
crufty whitespace-only string.
  • Loading branch information
Trott committed Feb 14, 2017
commit e749286d1021301088202d7eb87392ae9516eb34
3 changes: 1 addition & 2 deletions test/parallel/test-tls-cert-chains-in-ca.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down