2019-08-05 12:03:23 +02:00
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
|
|
|
|
if (!common.hasCrypto)
|
|
|
|
common.skip('missing crypto');
|
|
|
|
|
2019-12-25 18:02:16 +01:00
|
|
|
const assert = require('assert');
|
2019-08-05 12:03:23 +02:00
|
|
|
const tls = require('tls');
|
|
|
|
|
2019-12-25 18:02:16 +01:00
|
|
|
assert.throws(
|
2019-08-05 12:03:23 +02:00
|
|
|
() => {
|
|
|
|
tls.createSecureContext({ privateKeyEngine: 0,
|
|
|
|
privateKeyIdentifier: 'key' });
|
|
|
|
},
|
|
|
|
{ code: 'ERR_INVALID_ARG_TYPE',
|
2019-09-23 08:17:25 +02:00
|
|
|
message: / Received type number \(0\)$/ });
|
2019-08-05 12:03:23 +02:00
|
|
|
|
2019-12-25 18:02:16 +01:00
|
|
|
assert.throws(
|
2019-08-05 12:03:23 +02:00
|
|
|
() => {
|
|
|
|
tls.createSecureContext({ privateKeyEngine: 'engine',
|
|
|
|
privateKeyIdentifier: 0 });
|
|
|
|
},
|
|
|
|
{ code: 'ERR_INVALID_ARG_TYPE',
|
2019-09-23 08:17:25 +02:00
|
|
|
message: / Received type number \(0\)$/ });
|