summaryrefslogtreecommitdiff
path: root/test/parallel/test-tls-ca-concat.js
blob: 38a6a4dfec378fb07af773d4620ff226de30770c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'use strict';
const common = require('../common');
const fixtures = require('../common/fixtures');

// Check ca option can contain concatenated certs by prepending an unrelated
// non-CA cert and showing that agent6's CA root is still found.

const {
  connect, keys
} = require(fixtures.path('tls-connect'));

connect({
  client: {
    checkServerIdentity: (servername, cert) => { },
    ca: `${keys.agent1.cert}\n${keys.agent6.ca}`,
  },
  server: {
    cert: keys.agent6.cert,
    key: keys.agent6.key,
  },
}, common.mustSucceed((pair, cleanup) => {
  return cleanup();
}));