1'use strict'; 2const common = require('../common'); 3 4if (!common.hasCrypto) 5 common.skip('missing crypto'); 6 7const assert = require('assert'); 8const tls = require('tls'); 9 10assert.throws( 11 () => { 12 tls.createSecureContext({ privateKeyEngine: 0, 13 privateKeyIdentifier: 'key' }); 14 }, 15 { code: 'ERR_INVALID_ARG_TYPE', 16 message: / Received type number \(0\)$/ }); 17 18assert.throws( 19 () => { 20 tls.createSecureContext({ privateKeyEngine: 'engine', 21 privateKeyIdentifier: 0 }); 22 }, 23 { code: 'ERR_INVALID_ARG_TYPE', 24 message: / Received type number \(0\)$/ }); 25