openssl 生成支持中文的CSR证书请求文件

创建配置文件 cn.cnf,内容如下

tring_mask = utf8only
[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no
[req_distinguished_name]
C = CN
ST = 上海
L = 上海
O = xxx 公司
OU = 科技部
CN = www.90.vc
emailAddress = i@90.vc
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = www.90.vc
DNS.2 = 90.vc
DNS.3 = blog.90.vc

创建完成后,使用如下命令生成 key 以及csr 文件

openssl req -utf8 -config cn.cnf -new -nodes -sha256 -newkey rsa:2048 -batch -keyout 90.vc.key -out 90.vc.csr