SelfSSL7 生成的 SSL 证书失败。有任何想法吗?

Dan*_*Dan 6 windows ssl

我有一个网络服务器(用于测试),我已经为其分配了 3 个 IP 地址。目标是拥有 3 个受 SSL 保护的网站。

我使用了 selfSSL7.exe 工具来生成证书:

selfssl7 /N cn=app.test.local /v 3650 /Q /T /X /F app.test.local.pfx /W password
selfssl7 /N cn=api.test.local /v 3650 /Q /T /X /F api.test.local.pfx /W password
selfssl7 /N cn=www.test.local /v 3650 /Q /T /X /F www.test.local.pfx /W password
Run Code Online (Sandbox Code Playgroud)

这会自动将证书安装到用户个人证书存储 (“MY”) 及其受信任的根证书颁发机构存储 (“root”) 中。

为了确定没有来自之前尝试的工件,我首先运行:

certutil –delstore MY app.test.local
certutil –delstore root app.test.local
etc... for the other sites.
Run Code Online (Sandbox Code Playgroud)

这从有问题的 2 个商店中删除了证书。

我的问题是,当我运行时:

certutil -store my OR certutil -store root
Run Code Online (Sandbox Code Playgroud)

为了验证证书是否正常,我的 2 个新证书(不是全部 3 个!)显示以下错误:

ERROR: Certificate public key does NOT match stored keyset
Run Code Online (Sandbox Code Playgroud)

我不明白为什么会这样。有任何想法吗?

更新:

我注意到,当我逐步应用这 3 个证书时,最后一个应用的证书很好,以前的任何证书都失效了。我还注意到所有证书都具有相同的“唯一容器名称”。这会导致我的问题吗?我想知道是否可以在 SelfSSL7 中解决这个问题?

完整输出如下:

================ Certificate 2 ================
Serial Number: 152ac3a087bf4db944a57aae15b1567e
Issuer: CN=www.test.local
 NotBefore: 30/09/2011 10:56 AM
 NotAfter: 27/09/2021 10:00 AM
Subject: CN=www.test.local
Signature matches Public Key
Root Certificate: Subject matches Issuer
Template:
Cert Hash(sha1): 7f 6f e3 07 5d 29 e0 e7 24 4a 32 75 39 27 5c 71 ed 0f d6 e1
  Key Container = my
  Unique container name: 85c14c8bb87418bd9929adba2a9e9412_2259fcf6-b658-4ba5-aac3-35980c9148c2
  Provider = Microsoft RSA SChannel Cryptographic Provider

Certificate Public Key:
Version: 3
Public Key Algorithm:
    Algorithm ObjectId: 1.2.840.113549.1.1.1 RSA (RSA_SIGN)
    Algorithm Parameters:
    05 00
Public Key Length: 1024 bits
Public Key: UnusedBits = 0
    0000  30 81 89 02 81 81 00 c2  00 ed 38 1b 8d 01 16 3f
    0010  84 d2 97 7f 89 81 3f 19  c9 6b 8f d4 25 85 5d c8
    0020  89 b7 46 de 4a 1e 4f b1  6f ae 89 02 15 53 7d 04
    0030  d4 a6 98 7e 76 4b fc 31  02 3e 47 40 a3 d4 f6 6c
    0040  8b 24 ab ff 26 d1 46 c8  1a c2 6c 67 b6 30 91 f8
    0050  68 6f 95 c5 30 1a 38 49  77 6b 04 b7 8e 75 2e 8d
    0060  2f 70 85 65 6d 87 3e 6b  4c 4c f5 51 26 44 8c 77
    0070  51 dc e0 05 1d 48 9e 00  60 0e 45 19 ff 6f 44 77
    0080  c2 ec 75 50 58 05 b1 02  03 01 00 01
Key Id Hash(rfc-sha1): 70 2f c9 e6 90 cb 24 97 94 b9 ae 22 ca 17 08 04 8e a4 e9
c6
Key Id Hash(sha1): c2 83 14 50 76 18 5b 89 f6 f8 e3 7c 1e 93 68 bb d9 9e d6 26

Container Public Key:
Public Key Algorithm:
    Algorithm ObjectId: 1.2.840.113549.1.1.1 RSA (RSA_SIGN)
    Algorithm Parameters: NULL
Public Key Length: 1024 bits
Public Key: UnusedBits = 0
    0000  30 81 89 02 81 81 00 af  d3 6d e1 ac b7 f0 8a 9b
    0010  fd eb 99 08 73 e1 f7 9c  41 a5 51 82 a5 f8 f7 93
    0020  a8 0f 74 d6 74 a9 04 3e  1a d9 a6 7c 56 01 a0 e2
    0030  2d 92 ec c5 13 c9 0e c7  27 79 3c 5d 4d 31 e4 0e
    0040  0c 13 0e d0 b1 9d 2d 4d  8f c9 e8 8a 89 5b 9c 97
    0050  9f 38 6e 02 f1 19 7c 6a  4a db e9 b6 d0 80 b7 d8
    0060  ce a1 a3 13 3f e3 50 95  8e 02 75 73 94 5e 84 ed
    0070  36 17 a5 c4 50 c2 23 bb  22 dc fd 39 57 ed bd f0
    0080  9e eb da 15 d7 87 9d 02  03 01 00 01
Key Id Hash(rfc-sha1): 08 f4 65 d7 00 06 bb cd bb 37 1b e9 7d 48 17 18 cb 35 30
6d
Key Id Hash(sha1): 03 45 68 3a 1d 60 a1 d6 f6 5b 34 98 23 b1 50 11 d6 2d 4e bd

ERROR: Certificate public key does NOT match stored keyset
Encryption test FAILED
Run Code Online (Sandbox Code Playgroud)

Dan*_*Dan 3

我没有使用 SelfSSL7,而是尝试使用内部“makecert”工具,并且它生成的证书没有任何问题。

这是创建证书的命令,​​仅将其安装到当前计算机上的“MY”(个人)证书存储中,并将其输出到 CER 文件以在其他计算机上使用。

我的 makecert 实用程序位于C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\x64

makecert.exe -r -pe -a SHA256 -ss my -sr LocalMachine -n "CN="app.test.local -b 01/01/2011 -e 01/01/2050 -eku 1.3.6.1.5.5.7.3.1 -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 app.test.local.cer
Run Code Online (Sandbox Code Playgroud)

希望对某人有帮助。