我想问一下是否可以创建包含 SAN 记录的 CSR。
我创建了 keystore
keytool -genkeypair -keyalg RSA -keysize 2048 -alias testAlias -ext SAN=dns:test.example.com -keystore test.jks -storetype JKS -dname "CN=test"
我可以使用 keytool 检查 SAN 是否在 keystore 中
keytool -list -v -keystore test.jks
和输出的相关部分是
#1: ObjectId: 2.5.29.17 Criticality=false
SubjectAlternativeName [
DNSName: test.example.com
]
然后我使用 keytool 创建了 CSR:
keytool -certreq -file test.csr -keystore test.jks -alias testAlias
但在 CSR 中缺少有关 SAN 的信息。
如何检查:
keytool -printcertreq -file test.csr -v
正确应该有类似的东西
Extension Request:
#1: ObjectId: 2.5.29.17 Criticality=false
SubjectAlternativeName [
DNSName: test.example.com
]
我是否错过了
certreq
的某些选项? ?
最佳答案
当您生成 CSR 时,您需要指定 -ext 再次属性
keytool -certreq -file test.csr -keystore test.jks -alias testAlias -ext SAN=dns:test.example.com
关于certificate - 如何使用 keytool 使用 SAN 创建 CSR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30755220/