CSR生成证书与签发证书
2024-10-21 18:56:20
openSSL生成证书
- 生成根证书
// Generate CA private key
openssl genrsa -out ca.key 2048
// Generate CSR
openssl req -new -key ca.key -out ca.csr -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=Acme Root CA"
// Generate Self Signed certificate(CA 根证书)
openssl x509 -req -days 365 -in ca.csr -out ca.crt -signkey ca.key
- 使用根证书签名用户证书
// private key
openssl genrsa -out server.key 2048
// generate csr
openssl req -new -key server.key -out server.csr -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=ssl10.cdnpe.com"
// generate certificate
openssl x509 -req \
-in server.csr \
-out server.crt \
-CA ca.crt -CAkey ca.key -CAcreateserial -days 365
构造场景:
1、构造一个过期证书。调整系统时间
2、构造一个启用日期在当前日期之后的证书。 调整系统时间
openSSL关联多域名
1、生成私钥ca.key
openssl genrsa -out ca.key 2048
2、用ca.key请求csr
openssl req -new -x509 -days 365 -key ca.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=Acme Root CA" -out ca.crt
3、关联多个域名并生成crt证书(测试csr,无需操作以上步骤2,将生成的csr保存在csr格式的文件中,再使用该命令生成证书)
openssl x509 -req -extfile <(printf "subjectAltName=DNS:*.16tp.com,DNS:*.17tp.com") -days 365 -in bullet1.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out bullet1.crt
注明:设置关联域名(subjectAltName=DNS:域名,DNS:域名,DNS:域名)
第三方机构颁发自签名证书
第三方直接颁发自签名证书:http://www.ssleye.com/self_sign.html
阿里云CSR颁发自签名证书:https://www.chinassl.net/ssltools/free-ssl.html
如何搭建CA颁发机构
其他资料教程
最新文章
- 【知识积累】try-catch-finally+return总结
- mount什么意思
- [Mongodb]删除指定字段
- Eclipse&#183;如何关联Git库文件和添加JUint库
- CodeForces #100 C 贪心+STL
- sql like 时间
- Winform 关于委托与Invoke和Begin Invoke的使用
- nested pop animation can result in corrupted navigation bar
- leetcode处女作
- C#中启动外部应用程序
- Jsp分页实例---假分页
- 【ASP.NET Web API教程】2.3.7 创建首页
- 主机windwo7+虚拟机centos如何配置虚拟机可以上网,且与主机互ping通
- Linux 环境 Java JDK 安装&;基本配置
- python浅拷贝和深拷贝
- axios POST提交数据的三种请求方式写法
- 谈谈你对 Java 平台的理解
- 从统计局采集最新的省市区镇数据,用js在浏览器中运行 V2
- Java--- Ambiguous mapping. Cannot map ";***Controller"; been method解决办法
- ubuntu12.04+cuda6.0+caffe(新版)的安装
热门文章
- Django项目创建应用(二)
- moment 时区问题
- 【PS】PS如何扩展画布?
- Mybatis二级缓存(1)
- android9.0之后wifi热点原生接口开发示例
- 监听异常:The listener supports no services
- python存储xml格式数据
- 浏览器中通过js获取用户语言环境方法
- IT部门一线主管要如何才能对员工的某项工作的时间和难度评估心里有数?
- Rest-Assured:发送PATCH请求:更新Hello-imook(java.lang.IllegalArgumentException: Invalid number of path parameters. Expected 2, was 0. Undefined path parameters are: owner, repo.)