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

相关推荐
不要小看我们之间的羁绊啊2 小时前
【windows】cc + cc switch + headroom
windows
找死的豆腐4 小时前
基于.NET的Windows窗体编程之WinForms图像控件
windows·.net
XUHUOJUN5 小时前
Azure Local GPU 部署与企业应用场景指南(上篇 )
windows·microsoft·架构·nvidia·azure local
AOwhisky7 小时前
Python 基础语法(上篇 + 下篇)——综合自测题
linux·windows·python
埃博拉酱7 小时前
Pip/Conda 混用导致的 CRT 版本冲突问题:[WinError 1114] 动态链接库(DLL)初始化例程失败
windows·python
CoderYanger8 小时前
视频切割脚本(Python版)
linux·开发语言·windows·后端·python·程序人生·职场和发展
西游音月9 小时前
Windows环境下的WSL+Claude Code安装配置
windows·大模型·ai编程·wsl·claude code
小职boy19 小时前
不忘初心Windows系统工具箱下载 - 系统优化与维护工具(v1.1)
windows·系统·电脑软件·工具箱
Mininglamp_271820 小时前
Claude Code 封禁中国开发者之后:本地 AI 编程工具的替代方案实测
开发语言·人工智能·windows·开源软件·ai-native
贾斯汀frank21 小时前
C# 15 类型系统改进:Union Types
开发语言·windows·c#