How to use OpenSSL other version in addon.node? #4584
Replies: 1 comment
-
|
Hi @chinadeanls Because you are using Node.js 18.18.0, that distribution ships its own embedded OpenSSL ( Now you can achieve a custom version doing one of this 2 options: Option 1 - Link your own OpenSSL privatelyWhat this means?
How you can achieve this? Knowing that you are on Windows, first you'll have to build your own version of OpenSSL: perl Configure VC-WIN64A --prefix=C:\openssl-install --openssldir=C:\openssl-install no-shared
nmake
nmake installNote In this case let's suppouse you have the openssl in C:\openssl-install Once you have created that, you have to modify your {
"targets": [
{
"target_name": "xxx",
"sources": [ "src/xxx.cpp" ],
"include_dirs": [
"C:/openssl-install/include"
],
"libraries": [
"C:/openssl-install/lib/libcrypto_static.lib",
"C:/openssl-install/lib/libssl_static.lib"
],
"defines": [
"OPENSSL_API_COMPAT=0x30000000L",
"OPENSSL_NO_DEPRECATED"
]
}
]
}Important You cannot override Node's global OpenSSL used for TLS, HTTPS, crypto, QUIC, etc. Option 2 - Build your own version of node.If you absolutely need Node itself to use OpenSSL 3.0.3:
This guarantees your .node file will use OpenSSL 3.0.3, but:
Most people avoid this. SummaryThis behavior is expected. Hope this help you ! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Version
18.18.0
Platform
Subsystem
No response
What steps will reproduce the bug?
when i build xxx.node, and linking openssl lib. i got '3.0.10+quic' version in the xxx.node, but my openssl version is 'OpenSSL 3.0.3'.
How often does it reproduce? Is there a required condition?
every time
What is the expected behavior? Why is that the expected behavior?
build 'xxx.node' with other openssl
What do you see instead?
nothing
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions