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

待后续...

相关推荐
qq_479875431 天前
X-Macros(1)
linux·服务器·windows
jun_bai1 天前
python写的文件备份网盘程序
运维·服务器·网络
Warren981 天前
Python自动化测试全栈面试
服务器·网络·数据库·mysql·ubuntu·面试·职场和发展
欢喜躲在眉梢里1 天前
CANN 异构计算架构实操指南:从环境部署到 AI 任务加速全流程
运维·服务器·人工智能·ai·架构·计算
云飞云共享云桌面1 天前
无需配置传统电脑——智能装备工厂10个SolidWorks共享一台工作站
运维·服务器·前端·网络·算法·电脑
福尔摩斯张1 天前
《C 语言指针从入门到精通:全面笔记 + 实战习题深度解析》(超详细)
linux·运维·服务器·c语言·开发语言·c++·算法
虚伪的空想家1 天前
arm架构服务器使用kvm创建虚机报错,romfile “efi-virtio.rom“ is empty
linux·运维·服务器·javascript·arm开发·云原生·kvm
深藏bIue1 天前
linux服务器mysql目录下的binlog文件删除
linux·服务器·mysql
虾..1 天前
Linux 进程状态
linux·运维·服务器
只想安静的写会代码1 天前
网卡信息查询、配置、常见故障排查
linux·服务器·windows