openssl生成自签名证书

windows下安装openssl并生成自签名证书的命令如下:

需要注意的是:

  1. 每一级的证书中,证书的公司名称等尽量不要一样

  2. 根证书生成后,2级三级证书生成前,最好重新设置demoCA目录下的serial和index.txt文件中的内容。否则,极容易发生错误。

    openssl genrsa -des3 -out keys/RootCA.key 2048
    openssl req -new -x509 -days 3650 -key keys/RootCA.key -out keys/RootCA.crt

    openssl genrsa -des3 -out keys/secondCA.key 2048
    openssl rsa -in keys/secondCA.key -out keys/secondCA.key
    openssl req -new -days 3650 -key keys/secondCA.key -out keys/secondCA.csr
    openssl ca -extensions v3_ca -in keys/secondCA.csr -config ./cnf/openssl.cnf -days 3650 -out keys/secondCA.crt -cert keys/RootCA.crt -keyfile keys/RootCA.key

    openssl genrsa -des3 -out keys/thirdCA.key 2048
    openssl rsa -in keys/thirdCA.key -out keys/thirdCA.key
    openssl req -new -days 3650 -key keys/thirdCA.key -out keys/thirdCA.csr
    openssl ca -extensions v3_ca -in keys/thirdCA.csr -config ./cnf/openssl.cnf -days 3650 -out keys/thirdCA.crt -cert keys/secondCA.crt -keyfile keys/secondCA.key

    openssl genrsa -des3 -out keys/server.key 2048
    openssl rsa -in keys/server.key -out keys/server.key
    openssl req -new -days 3650 -key keys/server.key -out keys/server.csr
    openssl ca -in keys/server.csr -config ./cnf/openssl.cnf -days 3650 -out keys/server.crt -cert keys/thirdCA.crt -keyfile keys/thirdCA.key

相关推荐
ftpeak9 小时前
从零开始使用 axum-server 构建 HTTP/HTTPS 服务
网络·http·https·rust·web·web app
00后程序员张13 小时前
详细解析苹果iOS应用上架到App Store的完整步骤与指南
android·ios·小程序·https·uni-app·iphone·webview
weixin_4569042721 小时前
使用HTTPS 服务在浏览器端使用摄像头的方式解析
网络协议·http·https
不会叫的狼21 小时前
HTTPS + 域名 + 双向证书认证(下)
https
DoWhatUWant1 天前
域格YM310 X09移芯CAT1模组HTTPS连接服务器
服务器·网络协议·https
Whisper_Yu2 天前
计算机网络(一)基础概念
计算机网络·http·https·信息与通信
m0_749299952 天前
HTTP与HTTPS
网络协议·http·https
2501_916007473 天前
Transporter App 使用全流程详解:iOS 应用 ipa 上传工具、 uni-app 应用发布指南
android·ios·小程序·https·uni-app·iphone·webview
2501_915909063 天前
HTTPS 错误解析,常见 HTTPS 抓包失败、443 端口错误与 iOS 抓包调试全攻略
android·网络协议·ios·小程序·https·uni-app·iphone
乖女子@@@4 天前
协议_https协议
http·https·iphone