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

相关推荐
阿昭L35 分钟前
Windows认证和安全对象的基本概念
windows·安全
周山至水数翠峰1 小时前
Windows 事件与跨线程调用
windows
techdashen1 小时前
拆开任意 Electron 应用:从 Windows 安装包到 Discord 的私有更新协议
javascript·windows·electron
PascalMing2 小时前
从零实现一款 Windows 下的 SSH 批量运维工具:LinuxSshTools 技术详解
运维·windows·ssh
Cheng小攸2 小时前
CTF攻防综合实战(1)
windows
未力忘3 小时前
【无标题】
windows
大明者省3 小时前
在 Windows Server 2019 环境下配置 IIS 站点、本地端口服务、反向代理及内外网访问、多站点多服务部署
windows
您^_^3 小时前
ClaudeCode最近更新导致第三方模型Token消耗率暴涨,缓存命中也相当夸张!!
人工智能·windows·缓存·个人开发·claudecode·deepseek v4 pro
您^_^3 小时前
新手上路(四):Codex MCP 实战——让 Codex 连接外部世界
人工智能·windows·个人开发·codex·deepseek v4 pro
开开心心就好3 小时前
小白友好的程序联网封锁实用工具
windows·eureka·计算机外设·rabbitmq·word·excel·csdn开发云