mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
OpenSSL removed support for engines in version 4. Remove the Node.js APIs, constants, native bindings, and implementation that depend on ENGINE. Keep recognizing the former TLS and HTTPS engine options so their use fails explicitly instead of appearing to work while being ignored. Move DEP0183 directly from Documentation-only to End-of-Life after reverting its unreleased Runtime deprecation. Signed-off-by: Filip Skokan <panva.ip@gmail.com> Assisted-by: Codex 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>
96 lines
2.0 KiB
JavaScript
96 lines
2.0 KiB
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
const https = require('https');
|
|
const fixtures = require('../common/fixtures');
|
|
|
|
const agent = new https.Agent();
|
|
|
|
// empty argument
|
|
assert.strictEqual(
|
|
agent.getName(),
|
|
'localhost:::::::::::::::::::'
|
|
);
|
|
|
|
// empty options
|
|
assert.strictEqual(
|
|
agent.getName({}),
|
|
'localhost:::::::::::::::::::'
|
|
);
|
|
|
|
// Pass all options arguments
|
|
const options = {
|
|
host: '0.0.0.0',
|
|
port: 443,
|
|
localAddress: '192.168.1.1',
|
|
ca: 'ca',
|
|
cert: 'cert',
|
|
ciphers: 'ciphers',
|
|
crl: [Buffer.from('c'), Buffer.from('r'), Buffer.from('l')],
|
|
dhparam: 'dhparam',
|
|
ecdhCurve: 'ecdhCurve',
|
|
honorCipherOrder: false,
|
|
key: 'key',
|
|
pfx: 'pfx',
|
|
rejectUnauthorized: false,
|
|
secureOptions: 0,
|
|
secureProtocol: 'secureProtocol',
|
|
servername: 'localhost',
|
|
sessionIdContext: 'sessionIdContext',
|
|
sigalgs: 'sigalgs',
|
|
};
|
|
|
|
assert.strictEqual(
|
|
agent.getName(options),
|
|
'0.0.0.0:443:192.168.1.1:ca:cert:ciphers:key:pfx:false:localhost:' +
|
|
'::secureProtocol:c,r,l:false:ecdhCurve:dhparam:0:sessionIdContext:' +
|
|
'"sigalgs"'
|
|
);
|
|
|
|
{
|
|
const baseOptions = {
|
|
host: '0.0.0.0',
|
|
port: 443,
|
|
};
|
|
|
|
const agent1 = fixtures.readKey('agent1.pfx');
|
|
const agent6 = fixtures.readKey('agent6.pfx');
|
|
|
|
assert.notStrictEqual(
|
|
agent.getName({
|
|
...baseOptions,
|
|
pfx: [{ buf: agent1, passphrase: 'sample' }],
|
|
}),
|
|
agent.getName({
|
|
...baseOptions,
|
|
pfx: [{ buf: agent6, passphrase: 'sample' }],
|
|
})
|
|
);
|
|
|
|
assert.notStrictEqual(
|
|
agent.getName({
|
|
...baseOptions,
|
|
pfx: [{ buf: agent1, passphrase: 'sample' }],
|
|
}),
|
|
agent.getName({
|
|
...baseOptions,
|
|
pfx: [{ buf: agent1, passphrase: 'different' }],
|
|
})
|
|
);
|
|
|
|
assert.notStrictEqual(
|
|
agent.getName({
|
|
...baseOptions,
|
|
pfx: [{ __proto__: { buf: agent1, passphrase: 'sample' } }],
|
|
}),
|
|
agent.getName({
|
|
...baseOptions,
|
|
pfx: [{ __proto__: { buf: agent6, passphrase: 'sample' } }],
|
|
})
|
|
);
|
|
}
|