Build scripts and tools that produce the openssl-native NuGet package — prebuilt OpenSSL binaries for Microsoft Windows (x86, x64 and ARM64) usable from C/C++ and .NET projects.
- Current referenced OpenSSL version: 3.5.9 LTS
- Current openssl-native NuGet version: 3.5.9
The OpenSSL sources are included as a git submodule (openssl/).
The build machine must be x64.
Version 18.11.1 (x64), with the C/C++ build tools for x86, x64 and ARM64. The v141, v142 and v143 toolsets are all required, as the package ships one static library per toolset.
Note:
nuget/build-openssl-target.cmdlocates Visual Studio underC:\Program Files\Microsoft Visual Studio\18\Enterpriseand maps toolsets to specific MSVC versions (v141 → 14.16, v142 → 14.29, v143 → 14.51). If you are using another edition (Community, Professional, Build Tools) or different toolset versions, update the script accordingly.
Download and install the win64 NASM installer from https://www.nasm.us/ (version 3.01 was used for the current build).
Add the NASM folder to the PATH environment variable.
Install Strawberry Perl (64-bit):
https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-64bit.msi
Then install the Text::Template module:
cpanm Text::Template
(or cpan Text::Template)
The folder containing nuget.exe must be in the PATH environment variable.
Fetch the submodule and check out the tag you want to ship:
git submodule update --init
cd openssl
git checkout <openssl-version-tag> # e.g. openssl-3.5.9
Set the <version> element and release notes in nuget/sources/openssl-native.nuspec to match.
cd nuget
build.cmd
build.cmd recreates the nuget\output folder, compiles OpenSSL for every supported architecture/toolset combination (x86, x64 and ARM64 with the v141, v142 and v143 toolsets — except ARM64, for which no v141 toolset exists), copies the binaries into the package layout under output\, and finally runs nuget pack to produce the .nupkg.