在 CRP 的验证阶段,SCEP 证书请求失败
本文提供了两种方法来帮助解决在验证过程中简单证书注册协议 (SCEP) 证书请求失败时。
症状
在证书注册点的验证阶段,SCEP 证书请求在 CRP) (失败。 因此,即使配置了 NDES,Android 和 iOS 设备也不会收到 SCEP 证书。
此外,CRP 日志中还会出现错误条目。
注意
默认日志文件位置为:
C:\Program Files\Microsoft Intune\NDESConnectorSvc\Logs\Logs\CertificateRegistrationPoint_xx_xx.svclog
三个日志条目指定了加密异常错误,如下图所示。
第一个错误条目
<Source Name=“CertificateRegistrationPoint” />
加密异常:System.Security.Cryptography.CryptographicException:m_safeCertContext句柄无效。
at System.Security.Cryptography.X509Certificates.X509Certificate.ThrowIfContextInvalid ()
at System.Security.Cryptography.X509Certificates.X509Certificate.SetThumbprint ()
at System.Security.Cryptography.X509Certificates.X509Certificate.GetCertHashString ()
at Microsoft.ConfigurationManager.CertRegPoint.Helper.ValidateChallenge (String base64Encodedtoken, X509Certificate2Collection encryptedCerts, X509Certificate2 SigningCert, String& decodedChallengePassword)
第二个错误条目
加密异常:System.Security.Cryptography.CryptographicException:m_safeCertContext句柄无效。
at System.Security.Cryptography.X509Certificates.X509Certificate.ThrowIfContextInvalid ()
at System.Security.Cryptography.X509Certificates.X509Certificate.SetThumbprint ()
at System.Security.Cryptography.X509Certificates.X509Certificate.GetCertHashString ()
at Microsoft.ConfigurationManager.CertRegPoint.Helper.ValidateChallenge (String base64Encodedtoken, X509Certificate2Collection encryptedCerts, X509Certificate2 SigningCert, String& decodedChallengePassword)
at Microsoft.ConfigurationManager.CertRegPoint.ChallengeValidation.ValidationPhase1 (VerifyChallengeParams 值、String& decodedChallenge、PKCSDecodedObject& pkcsObj)
第三个错误条目
加密异常:System.Security.Cryptography.CryptographicException:m_safeCertContext句柄无效。
at System.Security.Cryptography.X509Certificates.X509Certificate.ThrowIfContextInvalid ()
at System.Security.Cryptography.X509Certificates.X509Certificate.SetThumbprint ()
at System.Security.Cryptography.X509Certificates.X509Certificate.GetCertHashString ()
at Microsoft.ConfigurationManager.CertRegPoint.Helper.ValidateChallenge (String base64Encodedtoken, X509Certificate2Collection encryptedCerts, X509Certificate2 SigningCert, String& decodedChallengePassword)
at Microsoft.ConfigurationManager.CertRegPoint.ChallengeValidation.ValidationPhase1 (VerifyChallengeParams 值、String& decodedChallenge、PKCSDecodedObject& pkcsObj)
at Microsoft.ConfigurationManager.CertRegPoint.Controllers.CertificateController.VerifyRequest (VerifyChallengeParams 值)
原因
出现此问题是因为 NDES 连接器注册表设置中缺少负责验证证书请求的注册表项。
解决方案 1
完成以下步骤以重启 Intune 连接器服务:
在已安装连接器的服务器上,打开 “服务 ”管理单元。 为此,请打开“ 开始 ”菜单,输入
services.msc
,然后从结果列表中选择“ 服务 ”。在“服务”管理单元中,重启Intune连接器服务。
HKLM\Software\Microsoft\MicrosoftIntune\NDESConnector
检查注册表子项,验证是否已根据以下屏幕截图创建了注册表项。
如果重新启动服务或计算机无法解决问题,请继续执行解决方案 2。
解决方案 2
完成以下步骤以清除和重置模板名称:
在 NDES 计算机上,打开注册表并找到以下子项:
HKEY_LOCAL_Machine\Software\Microsoft\Cryptography\MSCEP
将模板值更改为默认 (IPSECIntermediateOffline) ,然后重启服务器。
服务器重启后,检查
HKEY_LOCAL_Machine\Software\Microsoft\MicrosoftIntune\NDESConnector
子项。 现在应会看到签名证书。创建密钥后,将下的
HKEY_LOCAL_Machine\Software\Microsoft\Cryptography\MSCEP
模板名称更改为为 SCEP 和 NDES 创建的自定义模板名称。