OpenSSL CSR签名不包括本地性

OpenSSL CSR签名不包括本地性,openssl,Openssl,我正在尝试签署一份由以下内容生成的CSR: openssl req -new -key private/web.key.pem -sha256 \ -extensions v3_ca -out certs/web.csr.pem \ -subj "/C=DE/ST=Example State/L=Exmaple City/O=Example Org/OU=Example Org Unit/CN=example.com/emailAddress=foo@example.com" 当我用

我正在尝试签署一份由以下内容生成的CSR:

openssl req -new -key private/web.key.pem -sha256 \
  -extensions v3_ca -out certs/web.csr.pem \
  -subj "/C=DE/ST=Example State/L=Exmaple City/O=Example Org/OU=Example Org Unit/CN=example.com/emailAddress=foo@example.com"
当我用

openssl req -in certs/web.csr.pem -text -noout
显示位置(有一个L=可见的示例城市)。然而,当我试图与

openssl ca -days 365 -keyfile private/ca.key.pem \
  -cert certs/ca.cert.pem -extensions v3_ca -md sha256 \
  -in certs/web.csr.pem -out certs/web.cert.pem

主题中不包含Localty/City,但它在X509v3扩展的“DirName”中可见。我很确定我在这里遗漏了一些明显的东西,但我需要一些帮助。

解决方法很简单。我错过了我的保单中的
localityName
,很明显,那时它不会被包括在内。这是一个工作示例:

[ policy_anything ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional