我使用自签名的CA证书来签署其他证书。对于某些证书,我需要指定主题替代名称。我可以在请求生成期间指定它们(openssl req ...
),并在.csr文件中看到它们。然后我使用CA证书对其进行签名。
openssl x509 -req -extensions x509v3_config -days 365 -in ${name}.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out ${name}.crt
和openssl.cnf文件中的下一节:
[ x509 ]
x509_extensions = x509v3_config
[ x509v3_config ]
copy_extensions = copy
但我在.crt文件中没有看到SAN。
我知道使用openssl ca ...
命令的解决方案,但我没有有效的[ca]
部分,也不想只是复制/粘贴它而不深入了解其含义。因此,我希望有另一种使用openssl x509 ...
命令的解决方案。