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

相关推荐
小羊没烦恼!3 天前
初探性能优化——2个月到4小时的性能提升
java·开发语言·windows·算法·c#
rockmelodies3 天前
# Windows Server2008 R2 Standard(SP1镜像U盘)重置本地管理员密码【完整详细步骤】
windows·密码破解
2501_916007473 天前
苹果商店iOS应用上架费用全面解析:开发者计划与审核费用计算
android·ios·小程序·https·uni-app·iphone·webview
Lsetea3 天前
证书没到期却报certificate has expired:OpenSSL定位中间证书与系统时间
运维·https·ssl证书·openssl·证书链
kakakahahahaha3 天前
Windows C盘空间不足的安全清理与迁移流程
windows·电脑·笔记本电脑·软件需求·c盘清理
做咩啊~3 天前
远程连接提示:身份验证错误,要求的函数不受支持
windows
2501_916008893 天前
如何实现iOS App代码混淆:SwiftShield使用指南
android·ios·小程序·https·uni-app·iphone·webview
SDWAN_Cheap3 天前
HTTPS到底加密了什么?
https·数据加密
百事牛科技3 天前
PPT只读怎么取消?四种情况分别处理
windows·powerpoint
2501_916008893 天前
怎么用 Godot 导出 iOS 应用并上架 App Store?签名字段该填什么?
android·ios·小程序·https·uni-app·iphone·webview