【问题标题】:Update SSL Certificate Issuer value更新 SSL 证书颁发者值
【发布时间】:2017-07-30 10:33:56
【问题描述】:

我已经使用以下命令创建了密钥、pem 和导出的证书

openssl genrsa -out Kumar.key 2048
openssl req -x509 -new -nodes -key Kumar.key -sha256 -days 1024 -out Kumar.pem
openssl pkcs12 -export -name Kumar -in Kumar.pem -inkey Kumar.key -out Kumar.p12

当我在机器个人商店安装证书时,它显示

Issue to KumarIssued by Kumar

我想将 Issued by value 更改为 localhost。

我应该更改还是使用任何其他命令来更新Issued by 的值?

感谢 id 提前。

【问题讨论】:

标签: ssl openssl certificate x509


【解决方案1】:

要将 Issued by 更改为 'localhost',您需要更改此行

openssl req -x509 -new -nodes -key Kumar.key -sha256 -days 1024 -out Kumar.pem

通过这个命令

openssl req -x509 -new -nodes -key Kumar.key -sha256 -days 1024 -out Kumar.pem -outform PEM -subj /CN=localhost

但是,这个命令“openssl req”将创建根证书,因此,Issued By value 将始终与 Issued To value 相同

您需要从此 CA 证书生成一个自签名证书,才能拥有颁发者 = localhost 和颁发者 = Kumar 请参阅this article 了解如何创建自签名证书,尤其是“创建证书”部分

# openssl ca -config intermediate/openssl.cnf \
      -extensions server_cert -days 375 -notext -md sha256 \
      -in intermediate/csr/www.example.com.csr.pem \
      -out intermediate/certs/www.example.com.cert.pem

但是,请记住,CA 名称为“localhost”是没有意义的,因为它没有定义特定实体,而是通用的。

【讨论】:

  • 不,它不起作用。使用您的建议时,这两个值相同。
  • 正如我在上面的回答中提到的,这些值将始终与您生成 CA 证书相同。你能显示你的 OpenSSL.cnf 文件的内容吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-07-03
  • 2019-08-04
  • 2016-03-01
  • 2017-08-31
  • 2012-03-25
  • 2016-07-17
相关资源
最近更新 更多