You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
build: v24.22.1 fails with --shared-openssl on OpenSSL 3.0.x: EVP_PKEY_PRIVATE_KEY not declared (deps/ncrypto) #66926
System OpenSSL: 3.0.2 (libssl-dev 3.0.2-0ubuntu1.x)
Compiler: g++-12 (12.3.0)
Python 3.10.12
What steps will reproduce the bug?
curl -fsO https://nodejs.org/dist/v24.22.1/node-v24.22.1.tar.gz
tar zxf node-v24.22.1.tar.gz &&cd node-v24.22.1
export CXX=g++-12
./configure --shared-openssl --ninja
make -j$(nproc)
What is the expected behavior?
The build ends successfully. deps/ncrypto/ncrypto.h already guards newer OpenSSL features with OPENSSL_VERSION_PREREQ(3, 0) and OPENSSL_VERSION_PREREQ(3, 2). This suggests that OpenSSL 3.0.x is a supported version for --shared-openssl.
What do you see instead?
The build stops with these errors:
../../deps/ncrypto/ncrypto.cc: In function 'ncrypto::EVPKeyPointer ncrypto::{anonymous}::NewDhPKey(const BIGNUM*, const BIGNUM*, const BIGNUM*, const BIGNUM*)':
../../deps/ncrypto/ncrypto.cc:235:18: error: 'EVP_PKEY_PRIVATE_KEY' was not declared in this scope; did you mean 'EVP_PKEY_PUBLIC_KEY'?
../../deps/ncrypto/ncrypto.cc:280:18: error: 'EVP_PKEY_PRIVATE_KEY' was not declared in this scope; did you mean 'EVP_PKEY_PUBLIC_KEY'?
../../deps/ncrypto/ncrypto.cc:3985:18: error: 'EVP_PKEY_PRIVATE_KEY' was not declared in this scope; did you mean 'EVP_PKEY_PUBLIC_KEY'?
ninja: build stopped: subcommand failed.
Additional information
The same build works with v24.18.1. That version does not use EVP_PKEY_PRIVATE_KEY in deps/ncrypto/ncrypto.cc. v22.23.4 does not use it either.
The bundled OpenSSL in deps/openssl defines the macro in evp.h:
OpenSSL 3.0.2 has EVP_PKEY_KEY_PARAMETERS, EVP_PKEY_PUBLIC_KEY, EVP_PKEY_KEYPAIR and OSSL_KEYMGMT_SELECT_PRIVATE_KEY. It does not have EVP_PKEY_PRIVATE_KEY.
Workaround: this compatibility define at the top of deps/ncrypto/ncrypto.cc fixes the build:
With this define, the full build passes on Ubuntu 22.04 (OpenSSL 3.0.2, g++-12). We add it with sed -i '1i ...' deps/ncrypto/ncrypto.cc before ./configure. We did not run the Node test suite on the result.
I did not find which release first used the macro. It is between v24.18.1 and v24.22.1.
Context: we build Node from source with --shared-openssl on Ubuntu 22.04 base images. We need v24.22.1 for the security fixes in the 2026-10-21 release.
Proposed fix: Guard the use of EVP_PKEY_PRIVATE_KEY in deps/ncrypto/ncrypto.cc, or add the compatibility define in ncrypto.h for OpenSSL versions that lack it.
FWIW we're testing against OpenSSL 3.0.21 in the Jenkins CI and this is passing for v24, so presumably the headers were updated in an OpenSSL 3.0.x release between 3.0.2 and 3.0.21.
Activity
richardlau commentedon Oct 22, 2026
FWIW we're testing against OpenSSL 3.0.21 in the Jenkins CI and this is passing for v24, so presumably the headers were updated in an OpenSSL 3.0.x release between 3.0.2 and 3.0.21.
panva commentedon Oct 23, 2026
#66931
crypto: fix builds with older OpenSSL 3.0