windows系统 源码编译 OpenSSL 1.1.1w

在 Windows 上从源码编译 OpenSSL 1.1.1w

(注意:该版本已于 2023 年 9 月结束生命周期,仅建议用于遗留系统维护)

使用 Visual Studio + Perl + NASM 方案。以下是详细步骤:

工具 推荐版本 说明
Visual Studio 2015/2017/2019/2022 安装"使用 C++ 的桌面开发"工作负载(含 MSVC 编译器)
Perl Strawberry Perl 5.32+ 官网下载,安装后验证 perl -v
NASM 2.15.05+ 官网下载,添加至系统 PATH(用于汇编优化,提升性能)
OpenSSL 源码 1.1.1w 官方归档

安装Visual Studio 2015

安装Strawberry Perl

安装NASM

安装后,添加Perl: \bin;site\bin 和 NASM: \bin到系统环境变量path中

使用 Visual Studio 编译

  1. 解压源码
    将 openssl-1.1.1w.tar.gz 解压至无空格路径(如 D:\openssl-src)。
  2. 打开开发命令提示符
    在开始菜单找到如图内容
  3. 进入源码目录:

#路径需要改成你的目录, perl命令(一次选一个)

cd D:\openssl-1.1.1w

perl Configure VC-WIN64A --prefix=D:\openssl-1.1.1w\lib\x64\release --openssldir=D:\openssl-1.1.1w (release)

perl Configure VC-WIN64A --debug --prefix=D:\openssl-1.1.1w\lib\x64\debug --openssldir=D:\openssl-1.1.1w (debug)

执行

nmake

执行测试(可选)

nmake test

安装(可执行,也可不执行)

nmake install

清理中间文件

nmake clean

编译动态库:

perl Configure VC-WIN32 --debug --prefix=E:\openssl\Lib\x32\Debug --openssldir=E:\openssl\SSL

perl Configure VC-WIN32 --prefix=E:\openssl\Lib\x32\Release --openssldir=E:\openssl\SSL

perl Configure VC-WIN64A --debug --prefix=E:\openssl\Lib\x64\Debug --openssldir=E:\openssl\SSL

perl Configure VC-WIN64A --prefix=E:\openssl\Lib\x64\Release --openssldir=E:\openssl\SSL

编译静态库:

perl Configure VC-WIN32 --debug --prefix=E:\openssl\Lib\x32\Debug --openssldir=E:\openssl\SSL no-shared

perl Configure VC-WIN32 --prefix=E:\openssl\Lib\x32\Release --openssldir=E:\openssl\SSL no-shared

perl Configure VC-WIN64A --debug --prefix=E:\openssl\Lib\x64\Debug --openssldir=E:\openssl\SSL no-shared

perl Configure VC-WIN64A --prefix=E:\openssl\Lib\x64\Release --openssldir=E:\openssl\SSL no-shared

相关推荐
dshudsnb15 小时前
[ 2026最新 ] 在 Windows 11 上恢复已删除文件的 10 大方法
windows
xiaoshuaishuai817 小时前
C# 实现百度搜索算法逆向
开发语言·windows·c#·dubbo
ycjunhua18 小时前
windows 安装PostgreSQL 数据库
数据库·windows·postgresql
一个人旅程~19 小时前
Linux Mint(Ubuntu)如何在没有网卡驱动情况下利用手机上网安装旧电脑网卡驱动程序指导书
linux·windows·经验分享·电脑
格林威19 小时前
AI视觉检测:模型量化后漏检率上升怎么办?
人工智能·windows·深度学习·数码相机·计算机视觉·视觉检测·工业相机
无限进步_20 小时前
【C++】寻找字符串中第一个只出现一次的字符
开发语言·c++·ide·windows·git·github·visual studio
Ops菜鸟(Xu JieHao)21 小时前
Linux 内网远程桌面Xrdp ~保姆级教程
linux·运维·服务器·windows·远程桌面·远程·xrdp
永不复还21 小时前
Windows 驱动开发(四)—— IRP Pending
windows·驱动开发
海寻山1 天前
Java 泛型 (Generic) 入门到精通:语法 + 原理 + 实战 + 避坑
java·windows·python
idolao1 天前
PixPin 1.5安装与配置教程 Windows版:解压+管理员运行+自定义路径+开机自启设置指南
windows