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

相关推荐
LUCIAZZZ13 小时前
HTTPS优化简单总结
网络·网络协议·计算机网络·http·https·操作系统
2501_9159184117 小时前
iOS 开发全流程实战 基于 uni-app 的 iOS 应用开发、打包、测试与上架流程详解
android·ios·小程序·https·uni-app·iphone·webview
Mysticbinary1 天前
BurpSuite 代理原理 和 证书钉扎检测技术
http·https·网络代理·代理·网络流量·websockets·证书钉扎
想睡hhh2 天前
HTTPS协议——对于HTTP的协议的加密
http·https
司徒小夜2 天前
HTTP与HTTPS杂谈-HTTPS防御了什么
网络·http·https
一只游鱼3 天前
利用keytool实现https协议(生成自签名证书)
网络协议·http·https·keytool
吐个泡泡v3 天前
网络编程基础:一文搞懂 Socket、HTTP、HTTPS、TCP/IP、SSL 的关系
网络·网络协议·http·https·socket·ssl·tcp
2501_916008893 天前
uni-app iOS 文件管理与 itools 配合实战,多工具协作的完整流程
android·ios·小程序·https·uni-app·iphone·webview
2501_916007473 天前
uni-app iOS 文件调试常见问题与解决方案:结合 itools、克魔、iMazing 的实战经验
android·ios·小程序·https·uni-app·iphone·webview
2501_915918413 天前
uni-app 项目 iOS 上架踩坑经验总结 从证书到审核的避坑指南
android·ios·小程序·https·uni-app·iphone·webview