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 []:zhang@xxx.com

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

相关推荐
likfishdn10 分钟前
Linux的文件与目录管理
linux·运维·服务器
渲染101专业云渲染12 分钟前
川翔云电脑优势总结
服务器·3d·电脑·blender·maya
chian-ocean30 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=32 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
橘子味的茶二41 分钟前
高级系统架构师--第十章:计算机网络
服务器·计算机网络·系统架构
紫菜(Nori)1 小时前
短连接服务器压测-wrk
服务器·压力测试
陆沙1 小时前
deepseek-r1-centos-本地服务器配置方法
linux·服务器·centos
Tisfy5 小时前
LeetCode 1472.设计浏览器历史记录:一个数组完成模拟,单次操作均O(1)
服务器·leetcode·浏览器·memcached·题解·模拟·数组
子蛟7 小时前
Get a free SSL certificate interface.
c#·ssl