随笔 - 911  文章 - 5  评论 - 94  阅读 - 243万

OpenSSL生成证书申请-增加可选名称

1.修改

修改vim /etc/pki/tls/openssl.cnf

# 取消req下被注释的第2行
[ req ]
distinguished_name = req_distinguished_name
req_extensions = v3_req

 

# 删除req_distinguished_name下的0.xxx 的标签,把0.xxx的0. 去掉
[ req_distinguished_name ]
countryName              = Country Name (2 letter code)
countryName_default = CN
stateOrProvinceName             = State or Province Name (full name)
stateOrProvinceName_default = ShangHai
localityName              = Locality Name (eg, city)
localityName_default = ShangHai
organizationalUnitName             = Organizational Unit Name (eg, section)
organizationalUnitName_default = Domain Control Validated
commonName         = Internet Widgits Ltd
commonName_max = 64

 

# 在[ v3_req ]下新增最后一行内容 subjectAltName = @alt_names
[ v3_req ]
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names

 

# 新增 alt_names,注意括号前后的空格,DNS.x 的数量可以自己加
[ alt_names ]
DNS.1 = *.test.com
DNS.2 = a.test.cn

 

2.生成私钥和证书申请文件:

openssl genrsa -out private.key 1024

openssl req -new -key private.key -out cert.csr

cert.csr即为证书申请文件

posted on   momingliu11  阅读(737)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2021-08-03 Linux常用命令
2021-08-03 CentOS安装Zabbix-agent4.0
2020-08-03 PowerShell函数当做变量传递给另一个函数
2020-08-03 Jenkins input获取提交人
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示