1.概述
官网:
Quick start
1.Install Perl
2.Install NASM
3.Make sure both Perl and NASM are on your %PATH%
4.Use Visual Studio Developer Command Prompt with administrative privileges, choosing one of its variants depending on the intended
rchitecture. Or run cmd and execute vcvarsall.bat with one of the options x86, x86_amd64, x86_arm, x86_arm64, amd64, amd64_x86,
amd64_arm, or amd64_arm64. This sets up the environment variables needed for nmake.exe, cl.exe, etc. See also
https://docs.microsoft.com/cpp/build/building-on-the-command-line
5.From the root of the OpenSSL source directory enter
perl Configure VC-WIN32 if you want 32-bit OpenSSL or
perl Configure VC-WIN64A if you want 64-bit OpenSSL or
perl Configure VC-WIN64-ARM if you want Windows on Arm (win-arm64) OpenSSL or
perl Configure to let Configure figure out the platform
6.nmake
7.nmake test
8.nmake install
2.安装Perl
官网:
选择zip压缩包最新版本下载。
压缩包strawberry-perl-5.32.1.1-64bit.zip解压到合适目录,并配置环境变量。
3.安装NASM
官网:
选择最新版本windows64版本zip压缩包,这里是2.16.01。下载后解压
nasm-2.16.01-win64.zip到合适目录并配置环境变量。
4.安装Visual Studio
官网:
Visual Studio: IDE and Code Editor for Software Developers and Teams
安装过程不赘述。
Nmake 需要配置好系统环境变量。
5.下载OpenSSL源码zip包
6.根据步骤完成设置
6.1打开visualstudio2019命令行
6.2进入oppensl源码路径
6.3按概述部分中的第5步操作:
5.From the root of the OpenSSL source directory enter
perl Configure VC-WIN32 if you want 32-bit OpenSSL or
perl Configure VC-WIN64A if you want 64-bit OpenSSL or
perl Configure VC-WIN64-ARM if you want Windows on Arm (win-arm64) OpenSSL or
perl Configure to let Configure figure out the platform
在窗口中输入perl Configure VC-WIN64A,然后回车运行
接下来就需要等待一会,等待生成一些新的文件。
生成完成之后就会出现 OpenSSL has been successfully configured 的字样。
6.4 使用nmake命令进行编译
在窗口中输入nmake,然后回车
注意,此步骤大概需要30min左右时间
这步往后是用X64 Native Tools Command Prompt管理员身份打开的命令行。
6.5 使用nmake test对构建完成之后的模块进行测试
在窗口中输入nmake test,然后回车
注意,此步骤大概需要30min左右时间
如果测试成功,最后一行会出现Result:PASS字样
6.6 安装nmake install
在窗口中输入nmake install,然后回车
注意,此步骤大概需要30min左右时间
此步骤完成之后便可关闭窗口
生成的Openssl在路径 C:/Program Files/OpenSSL中。
选择bin文件夹的路径,将路径复制到环境变量中即可。
7.检验OpenSSL
按住 shift键 鼠标右击桌面,点击“在此处打开powershell窗口”,输入openssl version 查看,如果安装完成,即可显示出openssl当前的版本。至此,就要恭喜你openssl已经在你的电脑上安装完成了!
注:visual studio 2019 如果没有安装nmake,则需要自己通过visual studio Installer安装相关的vc++组件。