50% off 所有套餐限时优惠,起价 $2.48/mo
10 min left
Security & Networking

如何在 Windows 10 & 11 上安装 OpenSSL

Kelly Watson By Kelly Watson 10 min read Updated Sep 21, 2025
全息盾牌保护 Windows 徽标,象征在 Windows 上安装 OpenSSL 时提供的安全保护。

OpenSSL 是一个综合密码学库,实现了 SSL 和 TLS 协议标准。这些是现代 Windows 安全需求的基础。学习如何在 Windows 中使用 OpenSSL,可以解锁强大的加密工具。你将获得证书生成、安全通信和密码学操作,这些工具可以保护网络中的敏感数据。

Here’s what trips up most people: Windows doesn’t include OpenSSL by default, and the installation involves dependencies that aren’t obvious. Miss one step, and you’ll face the dreaded “command not recognized” error that leaves you wondering what went wrong. This guide covers exactly how to install OpenSSL with all the essential steps and troubleshooting tips you need.

TL;DR Summary

4 步安装流程:

  • 第一步:先下载 Microsoft Visual C++ 可再发行组件(这一步很关键,跳过的话 OpenSSL 就启动不了)
  • 第 2 步:从 https://slproweb.com/products/Win32OpenSSL.html 下载 Win64OpenSSL 安装程序
  • 步骤 3: 配置 PATH 环境变量: C:\Program Files\OpenSSL-Win64\bin
  • 第 4 步:设置 OPENSSL_CONF 变量: C:\Program Files\OpenSSL-Win64\bin\openssl.cfg
  • 用以下方式测试 openssl version command
  • If you see a “not recognized” error, your PATH isn’t set correctly

在 Windows 10 & 11 上安装 OpenSSL 的前置要求

Windows 按钮图标,用于《如何在 Windows 10 & 11 上安装 OpenSSL》

在 Windows 上安装 OpenSSL 之前,你需要处理一些依赖项。把这个看作是为系统打好基础,跳过这一步,OpenSSL 就无法正常工作。

Requirement Windows 10 Windows 11 Notes
Architecture 32-bit/64-bit 64-bit recommended 选择与系统匹配的安装程序
Admin Rights Required Required 安装时必需
Visual C++ 2015-2019 2015-2022 从 Microsoft 下载
Disk Space 50MB minimum 50MB minimum Plus dependencies

关键依赖项 – Visual C++ Redistributables

这是大多数人容易踩坑的地方:Microsoft Visual C++ Redis 依赖库不仅是推荐使用的,而是完全必需的。OpenSSL 是用 Microsoft 编译器构建的,依赖特定的运行时库才能正常工作。

Without these redistributables, you’ll encounter DLL missing errors the moment you try running any OpenSSL command. The error messages are cryptic (something like “VCRUNTIME140.dll not found”), but the fix is simple.

下载对应架构版本:32 位系统使用 x86 包,64 位系统使用 x64 包。 最新支持版本 可在 Microsoft 官方文档中找到。

小贴士:先安装 Visual C++,再装 OpenSSL。顺序反了的话,你就得花时间排查问题而不是写代码。当你准备学习如何在 Windows 11 上安装 OpenSSL 时,流程和 Windows 10 完全一样,只是 Windows 11 系统通常默认已包含较新版本的 Visual C++。对于需要专用资源的企业级部署, 最佳的 Windows VPS 解决方案提供了大规模安全证书管理所需的性能和控制能力。

在 Windows 10 & 11 上安装 OpenSSL 的分步指南

Windows 图标创建步骤

现在我们准备好开始了。OpenSSL 的安装分为三个关键阶段:获取正确的文件、正确运行安装程序,以及配置 Windows 以便在需要时找到 OpenSSL。

正在下载 OpenSSL 用于 Windows

Head to the official source at https://www.openssl.org/ or go directly to the trusted Windows binary source at https://slproweb.com/products/Win32OpenSSL.html (Shining Light Productions). Don’t worry-despite the “Win32” in the URL, they provide the complete OpenSSL binary package for both architectures.

仔细选择你的架构:64位系统选用Win64OpenSSL-1_1_1k.exe,32位系统选用Win32OpenSSL-1_1_1k.exe。不确定你的系统是哪种?右键点击「此电脑」→ 属性,就能看到。了解 Linux 与 Windows、VPS 对比 帮助您为 SSL 基础设施需求选择合适的环境。

轻量版(Win64OpenSSL_Light-x.x.x.exe)只包含核心功能,完整版则包括所有内容,包括开发库。对大多数用户来说,轻量版完全能够处理证书操作。如果你想了解如何在 Windows 11 上安装 OpenSSL,下载流程保持不变,只需确保选择最新的兼容版本以获得最佳的 Windows 11 集成效果。

安装流程详解

Right-click your downloaded installer and select “Run as administrator.” This isn’t optional-OpenSSL needs to modify system directories and the Windows registry.

安装时看到目录选项时,保持默认设置即可:

  • 64-bit systems: C:\Program Files\OpenSSL-Win64
  • 32-bit systems: C:\Program Files\OpenSSL-Win32

Here’s a critical decision point: When asked about DLL placement, always select “Do NOT copy OpenSSL DLLs to Windows system directory.” This might seem counterintuitive, but copying DLLs globally creates version conflicts that are nightmares to debug later.

环境变量配置

就是在这里,我们教 Windows 如何找到 OpenSSL。

第一步:配置 PATH 变量。 把 PATH 变量想象成命令行工具的联系人列表。我们现在要添加 OpenSSL 的电话号码:

  • Right-click “This PC” and select Properties
  • Click “Advanced system settings”
  • Click the “Environment Variables” button
  • 在「系统变量」中,选择「Path」,然后点击「编辑」
  • Click “New” and add: C:\Program Files\OpenSSL-Win64\bin
  • Click “OK” on all windows to save changes

第 2 步:设置 OPENSSL_CONF 变量。 这告诉 OpenSSL 配置文件的位置:

  • 创建新系统变量:OPENSSL_CONF
  • Set value: C:\Program Files\OpenSSL-Win64\bin\openssl.cfg

快速测试方案:打开命令提示符,输入以下临时命令:

  • set Path=%Path%;C:\OpenSSL-Win64\bin
  • set OPENSSL_CONF=C:\OpenSSL-Win64\bin\openssl.cfg

windows-original-vps Windows VPS 托管

查看我们价格实惠的 Windows VPS 方案,采用强大硬件、最低延迟,以及免费 Windows 任选!

领取你的免费 Windows

验证安装

Windows 设备展示已验证的安装

现在是见证成果的时候了。这是关键时刻——让我们确保 OpenSSL 正常运行。

基本安装验证

第一步:打开一个新的命令提示符。 Important: Open a new 更改环境变量后的命令提示符窗口。之前打开的任何终端都不会注册这些更改。要正确打开 OpenSSL 在 Windows 中,需要使用全新的终端会话。

  • Press Windows+R, type “cmd” and press Enter
  • Or search “Command Prompt” in Windows search

步骤 2:测试 OpenSSL 版本 Type openssl version and hit Enter. If you see something like “OpenSSL 1.1.1g 21 Apr 2020” (version numbers vary), congratulations-you’re done with the basic setup. This simple command is how to check OpenSSL version in Windows and confirms proper PATH configuration.

如果看到 "'openssl' is not recognized as an internal or external command",说明你的 PATH 变量配置有问题。这个 "OpenSSL not recognized" 错误很常见,别担心 — 我们会在故障排除章节里解决它。

Functionality Testing

让我们验证 OpenSSL 的密码学函数是否正常工作。以下是必要的验证命令及其预期结果:

Command Purpose Expected Output Status Indicator
openssl version Check installation “OpenSSL 1.1.1g 21 Apr 2020” Installation successful
openssl rand -hex 10 Test encryption 随机十六进制字符串 核心功能正常运行
openssl genpkey -algorithm RSA -out test_key.pem Generate key File created Full functionality
echo %PATH% Verify PATH 显示 OpenSSL bin 目录 Environment configured

Run openssl rand -hex 10 你应该会看到一个随机的十六进制字符串出现。这证实了核心加密引擎正常运作,并展示了如何在 Windows 中有效地运行 OpenSSL 命令。

想要实际测试一下?试试生成一个私钥: openssl genpkey -algorithm RSA -out test_key.pem。这会在你的当前目录中生成一个 2048 位的 RSA 私钥文件。如果没有报错,说明 OpenSSL 已正常运行,可以进行 SSL/TLS 协议操作。

想深入了解?生成证书签名请求: openssl req -new -key test_key.pem -out test_csr.pem系统会要求输入国家代码和组织名称等信息,测试时填入任何内容即可。

在开发环境中设置网络服务器时,了解 SSL 证书管理至关重要。请查看我们的指南 如何在 Windows 10 上安装 IIS 展示 OpenSSL 如何与网络服务器配置协同工作,实现全面的证书管理。

With over 85% of websites 现在使用 HTTPS 加密,部署可用的 OpenSSL 让你在安全通信和证书管理方面走在前面。

常见问题和故障排除

一台 Windows 设备,旁边放着一个圆锥体,象征故障排除的过程

即使完美地按照步骤操作,也可能遇到问题。这里是最常见的错误及解决方案 — 我见过很多次这些问题,你不是一个人在战斗。

Error Type Symptoms Primary Cause Quick Fix
“Not recognized” Command fails 未设置 PATH 添加到环境变量
DLL missing Startup error No Visual C++ Install redistributables
Access denied Permission error No admin rights Run as administrator

“OpenSSL is not recognized” Error Resolution

这个错误表示 PATH 环境变量配置有误,在 Windows 上安装 OpenSSL 时很常见。"OpenSSL 未被识别为内部或外部命令" 当系统无法找到 OpenSSL 可执行文件时会出现此消息。输入以下命令验证 PATH 内容 echo %PATH% 在命令提示符中。查看输出中的 C:\Program Files\OpenSSL-Win64\bin。看不到?那就是你的问题了。

以下是解决方法:

  • 关闭所有命令提示符窗口(这很重要)
  • Go 返回系统属性 → 高级 → 环境变量
  • 确认你已将正确的路径添加到系统 PATH 变量中
  • Open a new 打开命令行试试 openssl version again

Still not working? Try the nuclear option: restart your computer. Windows sometimes needs a full reboot to recognize PATH changes, especially if you have multiple terminal windows open. If you continue experiencing the “OpenSSL is not recognized as an internal or external command” error after reboot, verify your installation path matches exactly what you added to the PATH variable.

权限和 DLL 问题

If you’re seeing “Access is denied” errors, you’re not running with sufficient privileges. Some OpenSSL operations require administrative rights, particularly when dealing with system certificates.

Missing DLL errors usually point back to Visual C++ Redistributables. The error messages look scary-things like “The program can’t start because VCRUNTIME140.dll is missing”—but the fix is straightforward: download and install the official Windows environment variables documentation,这说明了完整的系统架构。

小贴士:如果安装 Visual C++ Redistributables 后仍然出现 DLL 问题,尝试完全卸载 OpenSSL 后重新安装。有时首次安装会因为依赖项不到位而出现混乱。在 Windows 新环境中安装 OpenSSL 时,按照依赖顺序安装可以避免大部分安装冲突。

For users managing multiple OpenSSL versions or looking for how to update OpenSSL on Windows, the safest approach involves uninstalling the current version through Windows Add/Remove Programs, then downloading and installing the latest version from the official sources. This process ensures clean configuration files and prevents version conflicts that can cause cryptographic operations to fail.

windows-vps Windows 10 VPS 托管

获得一个高效的 Windows 10 VPS 用于远程桌面,价格最优。免费运行 Windows 10,配置 NVMe SSD 存储和高速互联网。

查看 Windows 10 VPS 方案

Conclusion

正确安装 OpenSSL 需要关注依赖项、环境变量和验证步骤。按照本指南操作,可以确保 SSL/TLS 在你的 Windows 开发环境中运行可靠。你将获得安全的证书管理和加密通信,这对现代应用至关重要。

安装成功的关键是:先安装 Visual C++ Redistributables,正确配置 PATH 变量,然后用基本命令验证功能。大多数安装问题源于遗漏依赖或环境配置错误,按照故障排除步骤都能解决。无论在 Windows 上安装 OpenSSL 用于开发还是生产环境,这些基础步骤在所有 Windows 版本上都是一样的。

FAQ

我能在没有管理员权限的情况下安装 OpenSSL 吗?

不行,在 Windows 上安装 OpenSSL 必须拥有管理员权限。安装过程涉及系统级别的修改、注册表编辑,以及在受保护目录中放置文件。如果你在公司锁定的机器上工作,有几个选择:请 IT 部门代为安装,或者考虑绿色版本,可以从用户目录运行(不过这样就没有全系统 PATH 集成了)。

Win32 和 Win64 OpenSSL 版本有什么区别?

Win64 版本为 64 位 Windows 系统构建,能更高效地处理大内存操作。对于现代 Windows 10 和 11 系统来说,这是更好的选择。Win32 版本可以在 32 位和 64 位系统上运行,但受限于 32 位内存寻址。除非你有特定的理由需要 32 位兼容性(比如支持遗留应用),在现代系统上总是选择 Win64。

为什么 OpenSSL 需要 Visual C++ Redis 可再发行组件?

原因很简单:OpenSSL 是用 Microsoft Visual C++ 编译的,所以它需要特定的运行库才能工作。这些可再发行运行库包含 MSVCR140.dll 和 VCRUNTIME140.dll 等关键 DLL 文件,OpenSSL 运行时会调用它们。这就像汽车需要合适的引擎才能启动。没有这些库,OpenSSL 根本无法启动——它缺少自己依赖的核心组件。

安装后如何验证我的 OpenSSL 版本?

最快的验证方法是在命令提示符中运行 openssl version 命令。这是检查 Windows 中 SSL 版本的标准方式,如果安装正确会显示版本信息。

我可以同时安装多个 OpenSSL 版本吗?

虽然通过安装到不同目录在技术上可行,但因为 PATH 冲突不建议这样做。如果你想了解如何在 Windows 上将 OpenSSL 更新到新版本,请先卸载当前版本,再安装更新版本,以避免配置问题。

Share

博客更新

Keep reading.

MikroTik L2TP VPN 指南的 Cloudzy 标题图像,展示笔记本电脑通过发光的蓝色和金色数字隧道连接到服务器机架,并配有盾牌图标。
Security & Networking

MikroTik L2TP VPN 设置(含 IPsec):RouterOS 指南(2026)

在这个 MikroTik L2TP VPN 设置中,L2TP 处理隧道,IPsec 处理加密和完整性验证。将两者结合使用可以获得原生客户端兼容性,无需第三方工具。

Rexa CyrusRexa Cyrus 9 min read
终端窗口显示 SSH 警告信息,提示远程主机标识已更改。深蓝绿色背景上显示修复指南标题和 Cloudzy 品牌标识。
Security & Networking

警告:远程主机标识已更改及修复方法

SSH 是一种安全网络协议,可在系统之间创建加密隧道。在需要远程访问计算机但无需图形界面的开发者中仍然广泛使用。

Rexa CyrusRexa Cyrus 10 min read
DNS 服务器故障排查指南插图,深色背景上显示警告符号和蓝色服务器,用于 Linux 名称解析错误。
Security & Networking

名称解析临时失败:含义和修复方法?

使用 Linux 时,在尝试访问网站、更新软件包或执行需要网络连接的任务时,可能会遇到名称解析临时失败错误。

Rexa CyrusRexa Cyrus 12 min read

Ready to deploy? From $2.48/mo.

独立云服务,始于2008年。AMD EPYC、NVMe,40 Gbps。14天退款保障。