2015-12-11 15:47:39 -05:00
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
|
2016-12-17 07:05:45 -08:00
|
|
|
// Verify connection with explicitly created client SecureContext.
|
2015-12-11 15:47:39 -05:00
|
|
|
|
2016-12-17 07:05:45 -08:00
|
|
|
const join = require('path').join;
|
|
|
|
const {
|
|
|
|
assert, connect, keys, tls
|
2017-03-01 08:16:48 +01:00
|
|
|
} = require(join(common.fixturesDir, 'tls-connect'));
|
2015-12-11 15:47:39 -05:00
|
|
|
|
2016-12-17 07:05:45 -08:00
|
|
|
connect({
|
|
|
|
client: {
|
2015-12-11 15:47:39 -05:00
|
|
|
servername: 'agent1',
|
2016-12-17 07:05:45 -08:00
|
|
|
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();
|
2015-12-11 15:47:39 -05:00
|
|
|
});
|