node/test/addons/openssl-providers/test-legacy-provider-config.js
Richard Lau 53ec358606
test: add OpenSSL 3.x providers test
Add basic tests for providers when using OpenSSL 3.x.

PR-URL: https://github.com/nodejs/node/pull/44148
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2022-08-24 14:31:32 +00:00

22 lines
667 B
JavaScript

'use strict';
const common = require('../../common');
const { path: fixture } = require('../../common/fixtures');
const providers = require('./providers.cjs');
const assert = require('node:assert');
const { fork } = require('node:child_process');
const option = `--openssl-config=${fixture('openssl3-conf', 'legacy_provider_enabled.cnf')}`;
if (!process.execArgv.includes(option)) {
const cp = fork(__filename, { execArgv: [option] });
cp.on('exit', common.mustCall((code, signal) => {
assert.strictEqual(code, 0);
assert.strictEqual(signal, null);
}));
return;
}
providers.testProviderPresent('default');
providers.testProviderPresent('legacy');