本地的ip实现https访问-OpenSSL安装+ssl正式的生成(Windows 系统)

1.下载OpenSSL软件

网站地址:Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions

安装: 一直点击下一步就可以了

2.设置环境变量

在开始菜单右键「此电脑」→「属性」→「高级系统设置」→「环境变量」

在Path 中添加一个: xxxx\OpenSSL-Win64\bin → 「保存变量」

在通过该命令验证:openssl version

3.打开安装OpenSSL的位置

进入→ xxxx\OpenSSL-Win64\bin → 查看是否有"openssl.cnf"文件,如果没有就创建

openssl.cnf :

复制代码
[ req ]
default_bits       = 2048
default_keyfile    = key.pem
distinguished_name = req_distinguished_name
x509_extensions    = v3_ca
prompt             = yes
​
[ req_distinguished_name ]
C  = CN
ST = Beijing
L  = Beijing
O  = MyCompany
OU = MyUnit
CN = localhost
​
[ v3_ca ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer
basicConstraints = CA:true
​

4.创建cert.pem 和 key.pem

4.1 修改自己的安装位置,运行下面命令

复制代码
openssl req -new -x509 -days 365 -nodes ^
  -config "D:\app\OpenSSL-Win64\OpenSSL-Win64\bin\openssl.cnf" ^  ----修改为自己的安装位置
  -out cert.pem -keyout key.pem
​

4.2 按照提示,确认信息。

4.3 查看证书信息

复制代码
openssl x509 -in cert.pem -text -noout
​

cert.pem:证书文件

key.pem:私钥文件

相关推荐
公子小六9 小时前
基于.NET的Windows窗体编程之WinForms滑块与上下控件
windows·microsoft·c#·.net·winforms
IPdodo_11 小时前
2026年爬虫代理 IP 选择指南:从可用率、延迟到成本验收
网络协议·tcp/ip·scrapy·http·https·beautifulsoup·httpx
瓦格哈儿13 小时前
删掉旧 SSL 证书会影响线上业务吗?风险点梳理
网络协议·https·ssl
学海浪太大14 小时前
笔记本电脑插入显示器没反应
windows
美酒没故事°14 小时前
https和tls有什么区别?
网络协议·http·https
黄一一91124315 小时前
告别手动敲字,本地截图 OCR,识别完直接复制!开源截图识别工具
windows·ocr·开源软件·贴图
Lsetea16 小时前
Cloudflare报526 Invalid SSL certificate:源站证书与Nginx回源TLS排查
nginx·https·ssl证书·cloudflare·tls
Lsetea16 小时前
SSL证书快过期怎么自动检查:用OpenSSL checkend做7天预警与线上证书验收
https·ssl证书·openssl·systemd·证书监控
洪流之源17 小时前
Windows 远程 Ubuntu 24.04 桌面
linux·windows·ubuntu
MetaLite17 小时前
HTTPS之外的响应加密-GCM序列化与处理器顺序
网络协议·http·https