Windows Server 2012 R2-Adfs-更新证书

Windows Server 2012 R2-Adfs-更新证书

我正在尝试替换 ADFS 上的证书。我有 wildcart 证书 *.abc.pl,请按照以下步骤操作:

  1. 登录 ADFS 服务器 -完毕
  2. 将新证书添加到服务器。确保将其添加到计算机帐户的个人证书存储中。我通常使用 MMC 中的证书管理单元执行此操作 - 完成 3. 查找新证书的指纹。可以通过查看证书的详细信息找到它;指纹通常位于证书详细信息列表的底部或附近,由 40 个十六进制字符组成。复制指纹并确保删除空格,因此它是一个 40 个字符的字符串;您稍后会需要它 -完毕 我在导入 OpenSSL 3 生成的 PFX 时遇到问题,尝试导入证书时密码不匹配。解决方法是使用此命令生成证书 openssl pkcs12 -export -certpbe PBE-SHA1-3DES -keypbe PBE-SHA1-3DES -nomac -inkey privatekey2024.key -in cer2024.cer -export -out cer2024_2016.pfx

4. 授予运行“Active Directory 联合身份验证服务”服务的服务帐户对私钥的读取权限。为此,请按照以下步骤操作:在 MMC 的证书管理单元中,右键单击证书,选择“所有任务”,然后选择“管理私钥…”:管理私钥管理私钥单击“添加…”以添加在服务器上运行 ADFS 服务的用户帐户并授予该用户的读取权限。单击权限对话框上的“确定”将其关闭。启动 AD FS 管理,在左侧窗格中展开“服务”,然后单击“证书”:AF FS 管理器证书 AF FS 管理器证书 -完毕 5. 从屏幕右侧的操作面板单击“设置服务通信证书…”:设置服务通信证书设置服务通信证书将显示一个对话框,其中显示服务器上可用的证书。选择要使用的新证书。如果不确定正确的证书,请依次选择每个证书,然后单击显示的“单击此处查看证书属性”链接,并将指纹与之前记录的指纹进行比较。选择正确的证书后,单击对话框中的“确定”。如果此时重新启动服务器或 ADFS 服务并连接到 ADFS,您仍会看到原始证书。GUI 中的更改会更改 ADFS 配置数据库中的配置,但不会更改绑定到 HTTP.sys 的证书。

  1. 要完成配置更改,必须运行以下 PowerShell 命令:Set-AdfsSslCertificate –Thumbprint 00112233445566778899aabbccddeeff00112233 其中 00112233445566778899aabbccddeeff00112233 应替换为您之前找到的指纹。

这里我有一个问题: 获取 ChildItem 证书:\LocalMachine\My

当我运行命令 $newThumbprint = "01329a975bc181abb65aca0e22ddc9b72c766cc5" #thumbprint 取自 *.abc.pl

设置 AdfsSslCertificate-Thumbprint $newThumbprintS

我有错误:

Set-AdfsSslCertificate : The certificate represented by thumbprint D65A9C243FFEB836ECB939ECC28F9E72BD982871 could not be found in the Target Computer Personal certificate store.  Check the thumbprint value and ensure that the desired certificate is installed in the Local Computer Personal certificate store.
At line:1 char:1
+ Set-AdfsSslCertificate -Thumbprint $newThumbprint
    + CategoryInfo          : InvalidArgument: (:) [Set-AdfsSslCertificate], DisplayableArgumentException
    + FullyQualifiedErrorId : The certificate represented by thumbprint D65A9C243FFEB836ECB939ECC28F9E72BD982871 could not be found in the Target Computer Personal c 
   ertificate store.  Check the thumbprint value and ensure that the desired certificate is installed in the Local Computer Personal certificate store.,Microsoft.Id  
  entityServer.Management.Commands.SetSslCertificateCommand

我没有找到带有该指纹的证书,不知道下一步该怎么做 :/

答案1

所以我通过 netsh http show sslcert 找到了这个指纹(但仍然卡住)
在此处输入图片描述

编辑:如何删除有问题的绑定:powershell(管理员)

→netsh http 显示 sslcert
http 删除 sslcert hostnameport=www.contoso.com:443

之后,命令
AdfsSslCertificate –Thumbprint 00112233445566778899aabbccddeeff00112233
运行正常,没有错误

相关内容