本地的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:私钥文件

相关推荐
beyond阿亮10 小时前
Hermes Agent 在Windows上接入飞书完整指南
人工智能·windows·ai·hermes agent
ba_pi10 小时前
windows Claude Code接入deepseek,全局配置
windows·claude·deepseek
stanleyrain10 小时前
Windows 实现 Linux 风格“选中即复制,中键即粘贴”操作指南
linux·运维·windows
开开心心就好11 小时前
免费开源的网课教学屏幕画板工具
windows·eureka·计算机外设·word·excel·etcd·csdn开发云
周杰伦fans11 小时前
C# 从 List 中移除另一个集合
windows·c#
qxl_79991513 小时前
Windows 显卡掉线无报警|模型推理全套防呆方案(实操完整版)
windows·stm32·单片机·推理显卡掉线误报警防呆
2501_915909061 天前
全面解析前端开发中常用的浏览器调试工具及其使用场景
android·ios·小程序·https·uni-app·iphone·webview
数智工坊1 天前
VMware 17 Pro 中 Ubuntu 虚拟机共享 Windows 文件夹(完美踩坑版)
linux·人工智能·windows·ubuntu
啊罗罗1 天前
windows下,c++的axv2+fma/avx-vnni加速计算demo
c++·windows·算法
IT WorryFree1 天前
Windows安装openclaw遇到powershell不见了
windows