1 OpenSSL 3.0版本在2020年五月發(fā)布
[if !supportLists]·?[endif]
OpenSSL3.0 在2020年5月發(fā)布了第一個(gè)版本,隨即在六月份又發(fā)布了一些alpha版本,版本修正了一些bug,增加了一些協(xié)議支持,繼續(xù)支持國(guó)密sm2 ,sm3 ,sm4(從1.1.1版本開始支持)。
[if !supportLists]·?[endif]
[if !supportLists]·?[endif]
3.0版本完全兼容1.1.1版本接口,但低級(jí)別的MD2, MD4, MD5, MDC2,SHA1, SHA224, SHA256, SHA384, SHA512,AES,DES,ECDH,DSA,ECDSA,RSA接口都會(huì)被警告將要被棄用。但文檔中沒(méi)有提及要用什么接口替換,估計(jì)是全部用EVP接口替換,我在項(xiàng)目中基本都替換為了EVP接口。
[if !supportLists]·?[endif]
2 OpenSSL 3.0版本使用VS2019編譯過(guò)程
源碼可以到官方網(wǎng)站或者直接使用git進(jìn)行下載
下載地址ffmpeg.vip
git clone?git://git.openssl.org/openssl.git
[if !supportLists]·?[endif]下載地址http://openssl.vip/download
默認(rèn)會(huì)安裝到用戶目錄
C:\Users\用戶名\AppData\Local\bin\NASM
配置windows的環(huán)境變量,將此路徑加入到環(huán)境變量path中
安裝好后,重新打開控制臺(tái)能夠運(yùn)行nasm 和perl命令
下載地址http://openssl.vip/download?安裝社區(qū)版本,安裝后注冊(cè)個(gè)用戶就可以免費(fèi)使用。
(1)進(jìn)入控制臺(tái)(運(yùn)行 CMD),或者編寫批處理bat文件
或者直接運(yùn)行菜單中的vs2019命令行編譯工具,選擇相應(yīng)的版本(x86和x64)
打開菜單中VS2019中有對(duì)應(yīng)的命令行工具,把地址復(fù)制過(guò)來(lái)
編譯32位庫(kù)版本
"c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"
編譯64位庫(kù)版本
"c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
cd openssl-3.0.0-alpha2
perl Configure { VC-WIN32 | VC-WIN64A | VC-WIN64I | VC-CE } --prefix=%OUTPATH%
perl Configure VC-WIN32
VC-WIN32 表示生成32位程序 --prefix 是編譯后輸出的路徑,默認(rèn)會(huì)生成到C:\Program Files (x86)目錄,因?yàn)橐獙懙紺盤,有可能會(huì)出錯(cuò),如果控制臺(tái)不是管理員方式運(yùn)行
#編譯庫(kù)源碼
nmake
#編譯測(cè)試程序
nmake test
# 安裝openssl
nmake install
將編譯好的文件安裝到指定目錄,默認(rèn)是C:\Program Files (x86)\OpenSSL,如果是在C盤,運(yùn)行控制臺(tái)是需要有管理員權(quán)限
'perl' 不是內(nèi)部或外部命令,也不是可運(yùn)行的程序
需要安裝perl
NMAKE : fatal error U1064: 未找到 MAKEFILE 并且未指定目標(biāo)
perl生成makefile失敗,可以清理掉重新生成,或者替換參數(shù)重新生成
NASM not found - make sure it's installed and available on %PATH%
安裝nasm或者配置取消nasm
It looks like you don't have either nmake.exe or dmake.exe on your PATH, so you will not be able to execute the commands from a Makefile. You can install dmake.exe with the Perl Package Manager by running:
需要安裝下載安裝dmake
ppm install?dmake
運(yùn)行時(shí)錯(cuò)誤:OPENSSL_Uplink(0FB024F8,08): no OPENSSL_Applink
復(fù)制applink.c文件到頭文件路徑#include <openssl/applink.c>