0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-tls-connect-secure-context.js
Druotic 85a5a2c228 test: replace common.fixturesDir w/ fixtures.path
PR-URL: https://github.com/nodejs/node/pull/15819
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-10 08:14:23 +02:00

26 lines
518 B
JavaScript

'use strict';
require('../common');
// Verify connection with explicitly created client SecureContext.
const fixtures = require('../common/fixtures');
const {
assert, connect, keys, tls
} = require(fixtures.path('tls-connect'));
connect({
client: {
servername: 'agent1',
secureContext: tls.createSecureContext({
ca: keys.agent1.ca,
}),
},
server: {
cert: keys.agent1.cert,
key: keys.agent1.key,
},
}, function(err, pair, cleanup) {
assert.ifError(err);
return cleanup();
});