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

待后续...

相关推荐
渲染101专业云渲染几秒前
川翔云电脑优势总结
服务器·3d·电脑·blender·maya
chian-ocean18 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=20 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
橘子味的茶二30 分钟前
高级系统架构师--第十章:计算机网络
服务器·计算机网络·系统架构
紫菜(Nori)1 小时前
短连接服务器压测-wrk
服务器·压力测试
陆沙1 小时前
deepseek-r1-centos-本地服务器配置方法
linux·服务器·centos
Tisfy5 小时前
LeetCode 1472.设计浏览器历史记录:一个数组完成模拟,单次操作均O(1)
服务器·leetcode·浏览器·memcached·题解·模拟·数组
wanhengidc8 小时前
单线服务器和双线服务器分别是指什么?
运维·服务器
tekin8 小时前
基于 Python 开发在线多人游戏服务器案例解析
服务器·python·游戏·在线多人游戏服务器
m0_748252389 小时前
Node.js HTTP模块详解:创建服务器、响应请求与客户端请求
服务器·http·node.js