mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 15:35:41 +00:00

Add `privateKeyIdentifier` and `privateKeyEngine` options to get private key from an OpenSSL engine in tls.createSecureContext(). PR-URL: https://github.com/nodejs/node/pull/28973 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
24 lines
592 B
JavaScript
24 lines
592 B
JavaScript
'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$/ });
|