build: respect OpenSSL's configured API level

Shared OpenSSL 3 builds configured with --api=1.1.1 reject
OPENSSL_API_COMPAT=30000. Cap the requested compatibility level at the
configured API level for both ncrypto targets, retaining the 3.0
deprecation checks where supported.

Fixes: https://github.com/nodejs/node/issues/66950
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66953
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Filip Skokan authored and GitHub committed 2026-10-25 10:44:54 +00:00
1 parent 45ae12c3aa
commit b41fabb13c
1 file changed
+6 -2
+6 -2
View File
@@ -9,15 +9,19 @@
'engine.cc',
'ncrypto.h',
],
# OpenSSL may be configured with --api below 3.0. Keep 3.0 deprecation
# checks where supported without exceeding its configured API level.
'ncrypto_openssl3_api_compat':
'(OPENSSL_CONFIGURED_API<30000?OPENSSL_CONFIGURED_API:30000)',
'ncrypto_strict_defines': [
'OPENSSL_API_COMPAT=30000',
'OPENSSL_API_COMPAT=<(ncrypto_openssl3_api_compat)',
'OPENSSL_NO_DEPRECATED',
],
'ncrypto_legacy_openssl_defines': [
'OPENSSL_API_COMPAT=0x10100000L',
],
'ncrypto_engine_defines': [
'OPENSSL_API_COMPAT=30000',
'OPENSSL_API_COMPAT=<(ncrypto_openssl3_api_compat)',
'OPENSSL_SUPPRESS_DEPRECATED',
'NCRYPTO_ENGINE_COMPAT=1',
],