不求甚解

此博客为个人学习之用,如与其他作品雷同,纯属巧合。

导航

漏洞 SSL / TLS:证书已过期

一、漏洞描述

远程服务器的SSL / TLS证书已过期。解决办法:用新的证书替换SSL / TLS证书。

二、windows下载OpenSSL 1.1.1w 

 Windows 64位版本(推荐尝试)

https://slproweb.com/download/Win64OpenSSL-1_1_1w.exe

Windows 32位版本

https://slproweb.com/download/Win32OpenSSL-1_1_1w.exe

最新下载链接(OpenSSL 3.5.2)

Win64 OpenSSL v3.5.2 Light:
https://slproweb.com/download/Win64OpenSSL-3_5_2.exe

Win64 OpenSSL v3.5.2 (Full):
https://slproweb.com/download/Win64OpenSSL-3_5_2.msi

三、使用 OpenSSL 生成自签名证书

以下步骤演示如何生成一个适用于本地开发或内网测试的证书,并打包为 .pfx 格式以便导入 IIS

# 1. 生成私钥和自签名证书

openssl req -x509 -newkey rsa:2048 -keyout server.key -out server.crt -days 365 -nodes -subj "/CN=192.168.1.100"

# 2. 生成带密码的 PFX(兼容 Windows)

openssl pkcs12 -export -out server.pfx -inkey server.key -in server.crt -name "My Web Server" -passout pass:123456

# 3. 验证 PFX

openssl pkcs12 -info -in server.pfx -passin pass:123456

#4. 在 IIS 中导入时

1. 打开 IIS 管理器
2. 服务器 → **服务器证书**
3. 右侧点击 **“导入”**
4. 选择 `server.pfx`
5. 输入你设置的密码(如 `MyPass123!`)
6. 勾选 **“允许导出私钥”**(如果需要备份)
7. 点击确定