11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_cirequire('../common'); 31cb0ef41Sopenharmony_ci 41cb0ef41Sopenharmony_ci// Verify connection with explicitly created client SecureContext. 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures'); 71cb0ef41Sopenharmony_ciconst { 81cb0ef41Sopenharmony_ci assert, connect, keys, tls 91cb0ef41Sopenharmony_ci} = require(fixtures.path('tls-connect')); 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_ciconnect({ 121cb0ef41Sopenharmony_ci client: { 131cb0ef41Sopenharmony_ci servername: 'agent1', 141cb0ef41Sopenharmony_ci secureContext: tls.createSecureContext({ 151cb0ef41Sopenharmony_ci ca: keys.agent1.ca, 161cb0ef41Sopenharmony_ci }), 171cb0ef41Sopenharmony_ci }, 181cb0ef41Sopenharmony_ci server: { 191cb0ef41Sopenharmony_ci cert: keys.agent1.cert, 201cb0ef41Sopenharmony_ci key: keys.agent1.key, 211cb0ef41Sopenharmony_ci }, 221cb0ef41Sopenharmony_ci}, function(err, pair, cleanup) { 231cb0ef41Sopenharmony_ci assert.ifError(err); 241cb0ef41Sopenharmony_ci return cleanup(); 251cb0ef41Sopenharmony_ci}); 261cb0ef41Sopenharmony_ci 271cb0ef41Sopenharmony_ciconnect({ 281cb0ef41Sopenharmony_ci client: { 291cb0ef41Sopenharmony_ci servername: 'agent1', 301cb0ef41Sopenharmony_ci secureContext: tls.createSecureContext({ 311cb0ef41Sopenharmony_ci ca: keys.agent1.ca, 321cb0ef41Sopenharmony_ci ciphers: null, 331cb0ef41Sopenharmony_ci clientCertEngine: null, 341cb0ef41Sopenharmony_ci crl: null, 351cb0ef41Sopenharmony_ci dhparam: null, 361cb0ef41Sopenharmony_ci passphrase: null, 371cb0ef41Sopenharmony_ci pfx: null, 381cb0ef41Sopenharmony_ci privateKeyIdentifier: null, 391cb0ef41Sopenharmony_ci privateKeyEngine: null, 401cb0ef41Sopenharmony_ci sessionIdContext: null, 411cb0ef41Sopenharmony_ci sessionTimeout: null, 421cb0ef41Sopenharmony_ci sigalgs: null, 431cb0ef41Sopenharmony_ci ticketKeys: null, 441cb0ef41Sopenharmony_ci }), 451cb0ef41Sopenharmony_ci }, 461cb0ef41Sopenharmony_ci server: { 471cb0ef41Sopenharmony_ci cert: keys.agent1.cert, 481cb0ef41Sopenharmony_ci key: keys.agent1.key, 491cb0ef41Sopenharmony_ci }, 501cb0ef41Sopenharmony_ci}, function(err, pair, cleanup) { 511cb0ef41Sopenharmony_ci assert.ifError(err); 521cb0ef41Sopenharmony_ci return cleanup(); 531cb0ef41Sopenharmony_ci}); 54