2015-12-11 21:47:39 +01:00
|
|
|
'use strict';
|
2017-10-06 18:40:26 +02:00
|
|
|
require('../common');
|
2015-12-11 21:47:39 +01:00
|
|
|
|
2016-12-17 16:05:45 +01:00
|
|
|
// Verify connection with explicitly created client SecureContext.
|
2015-12-11 21:47:39 +01:00
|
|
|
|
2017-10-06 18:40:26 +02:00
|
|
|
const fixtures = require('../common/fixtures');
|
2016-12-17 16:05:45 +01:00
|
|
|
const {
|
|
|
|
assert, connect, keys, tls
|
2017-10-06 18:40:26 +02:00
|
|
|
} = require(fixtures.path('tls-connect'));
|
2015-12-11 21:47:39 +01:00
|
|
|
|
2016-12-17 16:05:45 +01:00
|
|
|
connect({
|
|
|
|
client: {
|
2015-12-11 21:47:39 +01:00
|
|
|
servername: 'agent1',
|
2016-12-17 16:05:45 +01: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 21:47:39 +01:00
|
|
|
});
|