openSSL生成证书

  1. 生成根证书
// 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
  1. 使用根证书签名用户证书
// 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颁发机构

搭建CA机构教程:https://jamielinux.com/docs/openssl-certificate-authority/sign-server-and-client-certificates.html#create-a-certificate

其他资料教程

生成过期证书

x509 vs ca

签名服务端证书和客户端证书

ssl证书链

openssl官方文档

最新文章

  1. 【知识积累】try-catch-finally+return总结
  2. mount什么意思
  3. [Mongodb]删除指定字段
  4. Eclipse&#183;如何关联Git库文件和添加JUint库
  5. CodeForces #100 C 贪心+STL
  6. sql like 时间
  7. Winform 关于委托与Invoke和Begin Invoke的使用
  8. nested pop animation can result in corrupted navigation bar
  9. leetcode处女作
  10. C#中启动外部应用程序
  11. Jsp分页实例---假分页
  12. 【ASP.NET Web API教程】2.3.7 创建首页
  13. 主机windwo7+虚拟机centos如何配置虚拟机可以上网,且与主机互ping通
  14. Linux 环境 Java JDK 安装&amp;基本配置
  15. python浅拷贝和深拷贝
  16. axios POST提交数据的三种请求方式写法
  17. 谈谈你对 Java 平台的理解
  18. 从统计局采集最新的省市区镇数据,用js在浏览器中运行 V2
  19. Java--- Ambiguous mapping. Cannot map &quot;***Controller&quot; been method解决办法
  20. ubuntu12.04+cuda6.0+caffe(新版)的安装

热门文章

  1. Django项目创建应用(二)
  2. moment 时区问题
  3. 【PS】PS如何扩展画布?
  4. Mybatis二级缓存(1)
  5. android9.0之后wifi热点原生接口开发示例
  6. 监听异常:The listener supports no services
  7. python存储xml格式数据
  8. 浏览器中通过js获取用户语言环境方法
  9. IT部门一线主管要如何才能对员工的某项工作的时间和难度评估心里有数?
  10. Rest-Assured:发送PATCH请求:更新Hello-imook(java.lang.IllegalArgumentException: Invalid number of path parameters. Expected 2, was 0. Undefined path parameters are: owner, repo.)