Title: build: v24.22.1 fails with --shared-openssl on OpenSSL 3.0.x: EVP_PKEY_PRIVATE_KEY not declared (deps/ncrypto) · Issue #66926 · nodejs/node · GitHub
Open Graph Title: build: v24.22.1 fails with --shared-openssl on OpenSSL 3.0.x: EVP_PKEY_PRIVATE_KEY not declared (deps/ncrypto) · Issue #66926 · nodejs/node
X Title: build: v24.22.1 fails with --shared-openssl on OpenSSL 3.0.x: EVP_PKEY_PRIVATE_KEY not declared (deps/ncrypto) · Issue #66926 · nodejs/node
Description: Version v24.22.1 (source tarball from nodejs.org/dist) Platform Ubuntu 22.04, x86_64 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...
Open Graph Description: Version v24.22.1 (source tarball from nodejs.org/dist) Platform Ubuntu 22.04, x86_64 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 rep...
X Description: Version v24.22.1 (source tarball from nodejs.org/dist) Platform Ubuntu 22.04, x86_64 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 rep...
Opengraph URL: https://github.com/nodejs/node/issues/66926
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"build: v24.22.1 fails with --shared-openssl on OpenSSL 3.0.x: EVP_PKEY_PRIVATE_KEY not declared (deps/ncrypto)","articleBody":"### Version\n\nv24.22.1 (source tarball from nodejs.org/dist)\n\n### Platform\n\n- Ubuntu 22.04, x86_64\n- System OpenSSL: 3.0.2 (`libssl-dev` 3.0.2-0ubuntu1.x)\n- Compiler: g++-12 (12.3.0)\n- Python 3.10.12\n\n### What steps will reproduce the bug?\n\n```sh\ncurl -fsO https://nodejs.org/dist/v24.22.1/node-v24.22.1.tar.gz\ntar zxf node-v24.22.1.tar.gz && cd node-v24.22.1\nexport CXX=g++-12\n./configure --shared-openssl --ninja\nmake -j$(nproc)\n```\n\n### What is the expected behavior?\n\nThe 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`.\n\n### What do you see instead?\n\nThe build stops with these errors:\n\n```\n../../deps/ncrypto/ncrypto.cc: In function 'ncrypto::EVPKeyPointer ncrypto::{anonymous}::NewDhPKey(const BIGNUM*, const BIGNUM*, const BIGNUM*, const BIGNUM*)':\n../../deps/ncrypto/ncrypto.cc:235:18: error: 'EVP_PKEY_PRIVATE_KEY' was not declared in this scope; did you mean 'EVP_PKEY_PUBLIC_KEY'?\n../../deps/ncrypto/ncrypto.cc:280:18: error: 'EVP_PKEY_PRIVATE_KEY' was not declared in this scope; did you mean 'EVP_PKEY_PUBLIC_KEY'?\n../../deps/ncrypto/ncrypto.cc:3985:18: error: 'EVP_PKEY_PRIVATE_KEY' was not declared in this scope; did you mean 'EVP_PKEY_PUBLIC_KEY'?\nninja: build stopped: subcommand failed.\n```\n\n### Additional information\n\n- 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.\n- The bundled OpenSSL in `deps/openssl` defines the macro in `evp.h`:\n ```c\n #define EVP_PKEY_PRIVATE_KEY \\\n (EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PRIVATE_KEY)\n ```\n 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`.\n- **Workaround:** this compatibility define at the top of `deps/ncrypto/ncrypto.cc` fixes the build:\n ```c\n #ifndef EVP_PKEY_PRIVATE_KEY\n #define EVP_PKEY_PRIVATE_KEY (EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PRIVATE_KEY)\n #endif\n ```\n 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.\n- I did not find which release first used the macro. It is between v24.18.1 and v24.22.1.\n- 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.\n\n**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.\n","author":{"url":"https://github.com/dragos-cojocari","@type":"Person","name":"dragos-cojocari"},"datePublished":"2026-10-22T11:34:41Z","url":"https://github.com/nodejs/node/issues/66926"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7173d3f1-462a-1cdd-1430-3711865a0066 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8718:10F3E3:3B1B9E:4DBCF6:6AFBBBB6 |
| html-safe-nonce | 86953e99ffd0b07769f0ead50fd8e34888a85dbdca321d24774f04391e242160 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzE4OjEwRjNFMzozQjFCOUU6NERCQ0Y2OjZBRkJCQkI2IiwidmlzaXRvcl9pZCI6IjIzMTMyMzI2Mzk2ODAyOTc5MTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e95ea90e084dd2f7c3837bbbd3482ed9819e9d710deb6a4b42b0a104f79ce18c |
| hovercard-subject-tag | issue:5978507658 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/66926/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4c297f6a79252b9ad7459efd0800e56db339862bb229da5a1810174c4e16cc72/nodejs/node/issues/66926 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4c297f6a79252b9ad7459efd0800e56db339862bb229da5a1810174c4e16cc72/nodejs/node/issues/66926 |
| og:image:alt | Version v24.22.1 (source tarball from nodejs.org/dist) Platform Ubuntu 22.04, x86_64 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 rep... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dragos-cojocari |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e4cce0e99cf61481a318ff12c2e8580153a6c7c6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width