mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
This reverts commit da516920fc.
PR-URL: https://github.com/nodejs/node/pull/64777
Fixes: https://github.com/nodejs/node/issues/56733
Refs: https://github.com/nodejs/node/pull/64211
Refs: https://github.com/nodejs/node/pull/63966
Refs: https://github.com/nodejs/node/pull/53329
Refs: https://github.com/nodejs/node/pull/48950
Refs: https://github.com/nodejs/node/issues/45465
Refs: https://github.com/nodejs/node/issues/42827
Refs: https://github.com/nodejs/node/issues/47076
Refs: https://github.com/nodejs/node/pull/62862
Refs: https://github.com/nodejs/node/pull/38512
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
31 lines
751 B
JavaScript
31 lines
751 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
// Monkey-patch SecureContext
|
|
const { internalBinding } = require('internal/test/binding');
|
|
const binding = internalBinding('crypto');
|
|
const NativeSecureContext = binding.SecureContext;
|
|
|
|
binding.SecureContext = function() {
|
|
const rv = new NativeSecureContext();
|
|
rv.setClientCertEngine = undefined;
|
|
return rv;
|
|
};
|
|
|
|
const tls = require('tls');
|
|
|
|
{
|
|
assert.throws(
|
|
() => { tls.createSecureContext({ clientCertEngine: 'Cannonmouth' }); },
|
|
{
|
|
code: 'ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED',
|
|
message: 'Custom engines not supported by this OpenSSL'
|
|
}
|
|
);
|
|
}
|