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

相关推荐
几道之旅2 小时前
分别在windows和linux上使用curl,有啥区别?
linux·运维·windows
一直奔跑在路上3 小时前
【Ansible】基于windows主机,采用NTLM+HTTPS 认证部署
windows·https·ansible
郭逍遥3 小时前
[工具]B站缓存工具箱 (By 郭逍遥)
windows·python·缓存·工具
x-cmd4 小时前
[250512] Node.js 24 发布:ClangCL 构建,升级 V8 引擎、集成 npm 11
前端·javascript·windows·npm·node.js
熙曦Sakura4 小时前
【Linux网络】HTTPS
linux·网络·https
安装虚拟机的老师傅4 小时前
【2025最新】Windows系统装VSCode搭建C/C++开发环境(附带所有安装包)
c语言·windows·vscode·其他
文人sec5 小时前
接口自动化测试设计思路--设计实战
python·https·单元测试·自动化·pytest
越甲八千8 小时前
windowsC++操作ADB
c++·windows·adb
esmember9 小时前
电路研究9.3.4——合宙Air780EP中的AT开发指南:HTTPS示例
https·at指令