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
安装证书过程

待后续...

相关推荐
落笔画忧愁e22 分钟前
FastGPT快速将消息发送至飞书
服务器·数据库·飞书
小冷爱学习!28 分钟前
华为动态路由-OSPF-完全末梢区域
服务器·网络·华为
落幕1 小时前
C语言-进程
linux·运维·服务器
xmweisi4 小时前
【华为】报文统计的技术NetStream
运维·服务器·网络·华为认证
DC_BLOG5 小时前
Linux-GlusterFS进阶分布式卷
linux·运维·服务器·分布式
yourkin6665 小时前
TCP...
服务器·网络·tcp/ip
cookies_s_s6 小时前
Linux--进程(进程虚拟地址空间、页表、进程控制、实现简易shell)
linux·运维·服务器·数据结构·c++·算法·哈希算法
诶尔法Alpha7 小时前
Linux上使用dify构建RAG
linux·运维·服务器
熬夜苦读学习8 小时前
Linux文件系统
linux·运维·服务器·开发语言·后端
荔枝荷包蛋6668 小时前
【网络】高级IO——Reactor版TCP服务器
运维·服务器