summaryrefslogtreecommitdiff
path: root/test/parallel/test-tls-keyengine-invalid-arg-type.js
blob: 385841a6541f948880495cf0568e4d00d26a4190 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'use strict';
const common = require('../common');

if (!common.hasCrypto)
  common.skip('missing crypto');

const tls = require('tls');

common.expectsError(
  () => {
    tls.createSecureContext({ privateKeyEngine: 0,
                              privateKeyIdentifier: 'key' });
  },
  { code: 'ERR_INVALID_ARG_TYPE',
    message: / Received type number$/ });

common.expectsError(
  () => {
    tls.createSecureContext({ privateKeyEngine: 'engine',
                              privateKeyIdentifier: 0 });
  },
  { code: 'ERR_INVALID_ARG_TYPE',
    message: / Received type number$/ });