current commit
261025.12 · test,benchmark: drop OpenSSL 1.x-only coverage
// Flags: --expose-internals
'use strict';

const common = require('../common');

const { isBoringSSL } = require('../common/crypto');
if (!common.hasCrypto)
  common.skip('missing crypto');

const assert = require('assert');

// OpenSSL has a set of security levels which affect what algorithms
// are available by default. Different OpenSSL versions have different
// default security levels and we use this value to adjust what a test
// expects based on the security level. You can read more in
// https://docs.openssl.org/3.0/man3/SSL_CTX_set_security_level/#default-callback-behaviour
// This test simply validates that we can get some value for the secLevel
// when needed by tests.
const secLevel = require('internal/crypto/util').getOpenSSLSecLevel();
if (isBoringSSL) {
  assert.strictEqual(secLevel, 0);
} else {
  assert.ok(secLevel >= 0 && secLevel <= 5);
}