mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
077c75beae
Allow null along with undefined for pfx value. This is to avoid breaking change when upgrading v14 to v16 and 3rd party library passing null to pfx Fixes: https://github.com/nodejs/node/issues/36292 PR-URL: https://github.com/nodejs/node/pull/41170 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
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();
|
|
});
|
|
|
|
connect({
|
|
client: {
|
|
servername: 'agent1',
|
|
secureContext: tls.createSecureContext({
|
|
ca: keys.agent1.ca,
|
|
ciphers: null,
|
|
clientCertEngine: null,
|
|
crl: null,
|
|
dhparam: null,
|
|
passphrase: null,
|
|
pfx: null,
|
|
privateKeyIdentifier: null,
|
|
privateKeyEngine: null,
|
|
sessionIdContext: null,
|
|
sessionTimeout: null,
|
|
sigalgs: null,
|
|
ticketKeys: null,
|
|
}),
|
|
},
|
|
server: {
|
|
cert: keys.agent1.cert,
|
|
key: keys.agent1.key,
|
|
},
|
|
}, function(err, pair, cleanup) {
|
|
assert.ifError(err);
|
|
return cleanup();
|
|
});
|