openSSL生成WEB SSL证书

1.使用openSSL生成凭证与私钥:

bash 复制代码
openssl genrsa -out privatekey.pem 2048
openssl req -new -key privatekey.pem -out cert_req.pem
bash 复制代码
Country Name (2 letter code) [AU]:cn
State or Province Name (full name) [Some-State]:sh
Locality Name (eg, city) []:sh
Organization Name (eg, company) [Internet Widgits Pty Ltd]:zhang
Organizational Unit Name (eg, section) []:zhang
Common Name (e.g. server FQDN or YOUR name) []:zhang
Email Address []:[email protected]

2. 使用数字签名算法签名密钥

bash 复制代码
openssl x509 -sha256 -req -days 365 -in cert_req.pem -signkey privatekey.pem -out sign_cert.pem

并保存签名后的证书公钥文件

3. 自签名ca证书

openssl req -new -x509 -days 365 -key privatekey.pem -out ca_cert.pem

相关推荐
GalaxyPokemon2 小时前
Muduo网络库实现 [七] - Connection模块
linux·服务器·网络
慈云数据2 小时前
构建自己的私有 Git 服务器:基于 Gitea 的轻量化部署实战指南
服务器·git·gitea
the_nov3 小时前
19.TCP相关实验
linux·服务器·网络·c++·tcp/ip
Y淑滢潇潇4 小时前
RHCSA Linux 系统创建文件
linux·运维·服务器
XYN614 小时前
【嵌入式学习3】基于python的tcp客户端、服务器
服务器·开发语言·网络·笔记·python·学习·tcp/ip
the_nov4 小时前
20.IP协议
linux·服务器·网络·c++·tcp/ip
源代码•宸5 小时前
Visual Studio Code SSH 连接超时对策( keep SSH alive)
运维·服务器·ide·经验分享·vscode·ssh
zyx没烦恼5 小时前
Linux 下 日志系统搭建全攻略
linux·服务器·开发语言·c++
大橘6 小时前
centos8上实现lvs集群负载均衡dr模式
服务器·负载均衡·lvs
码上飞扬6 小时前
深入探索 Linux Top 命令:15 个实用示例
linux·运维·服务器