mirror of
https://github.com/nodejs/node.git
synced 2025-05-11 22:07:57 +00:00

PR-URL: https://github.com/nodejs/node/pull/17498 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Jon Moss <me@jonathanmoss.me>
28 lines
632 B
JavaScript
28 lines
632 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
// Monkey-patch SecureContext
|
|
const binding = process.binding('crypto');
|
|
const NativeSecureContext = binding.SecureContext;
|
|
|
|
binding.SecureContext = function() {
|
|
const rv = new NativeSecureContext();
|
|
rv.setClientCertEngine = undefined;
|
|
return rv;
|
|
};
|
|
|
|
const tls = require('tls');
|
|
|
|
{
|
|
common.expectsError(
|
|
() => { tls.createSecureContext({ clientCertEngine: 'Cannonmouth' }); },
|
|
{
|
|
code: 'ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED',
|
|
message: 'Custom engines not supported by this OpenSSL'
|
|
}
|
|
);
|
|
}
|