openssl生成自签证书

步骤

#创建两个文件 cn.cnf和server.cnf ,分别插入下面的内容

bash 复制代码
[ req ]
default_bits       = 4096
distinguished_name = req_distinguished_name
req_extensions     = req_ext
prompt             = no

[ req_distinguished_name ]
countryName                = CN
stateOrProvinceName        = BeiJing
localityName               = BeiJing
organizationName           = WeiOrg
organizationalUnitName     = WeiUnit
commonName                 = localhost

[ req_ext ]
subjectAltName = @alt_names

[ alt_names ]
DNS.1 = localhost
DNS.2 = example.com #配置域名的写法
IP.1  = 127.0.0.1
IP.2  = 192.168.110.9 #配置ip写法

分别执行下面的命令

bash 复制代码
openssl genpkey -algorithm RSA -out ca.key -pkeyopt rsa_keygen_bits:4096

openssl req -x509 -new -key ca.key -out ca.crt -days 3650 -config ca.cnf

openssl genpkey -algorithm RSA -out server.key -pkeyopt rsa_keygen_bits:4096

openssl req -new -key server.key -out server.csr -config server.cnf

openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 365 -extfile server.cnf -extensions req_ext
安装证书过程

待后续...

相关推荐
Sinclair3 天前
简单几步,安卓手机秒变服务器,安装 CMS 程序
android·服务器
Rockbean4 天前
用40行代码搭建自己的无服务器OCR
服务器·python·deepseek
茶杯梦轩4 天前
CompletableFuture 在 项目实战 中 创建异步任务 的核心优势及使用场景
服务器·后端·面试
海天鹰5 天前
【免费】PHP主机=域名+解析+主机
服务器
不是二师兄的八戒5 天前
Linux服务器挂载OSS存储的完整实践指南
linux·运维·服务器
芝士雪豹只抽瑞克五5 天前
Nginx 高性能Web服务器笔记
服务器·nginx
失重外太空啦5 天前
Tomcat
java·服务器·tomcat
Henry Zhu1235 天前
数据库:并发控制基本概念
服务器·数据库
茶杯梦轩5 天前
从零起步学习并发编程 || 第九章:Future 类详解及CompletableFuture 类在项目实战中的应用
服务器·后端·面试
ZeroNews内网穿透5 天前
谷歌封杀OpenClaw背后:本地部署或是出路
运维·服务器·数据库·安全