简体   繁体   English

IIS 7.5客户端证书身份验证

[英]IIS 7.5 Client certificate authentication

I have asp.net site on my local machine. 我的本地机器上有asp.net站点。

IIS configuration: binding: https binding with self-signed certificate, ssl settings: Require SSL and Require client certificates IIS配置:绑定:使用自签名证书的https绑定,ssl设置:需要SSL和需要客户端证书

I have installed next certificates on my machine: CA certificate (call it 'CA Center') in Trusted Root Certification Authorities store. 我已在我的计算机上安装了下一个证书:受信任的根证书颁发机构存储中的CA证书(称为“CA Center”)。 Client certificate issued by 'CA Center' in Personal store 个人商店中“CA Center”颁发的客户端证书

I go to site and accept server certificate. 我去网站并接受服务器证书。 But next i get error: 但接下来我得到错误:

HTTP Error 403.7 - Forbidden. HTTP错误403.7 - 禁止。 The page you are attempting to access requires your browser to have a Secure Sockets Layer (SSL) client certificate that the Web server recognizes. 您尝试访问的页面要求您的浏览器具有Web服务器可识别的安全套接字层(SSL)客户端证书。

That means browser (IE) doesn't send applicable client certificates to server. 这意味着浏览器(IE)不会向服务器发送适用的客户端证书。

What's wrong? 怎么了? Should I configure something else? 我应该配置其他东西吗?

I had exactly this problem, and it took me an age to figure out the cause. 我确实遇到了这个问题,我花了一个年头才找出原因。 Turned out it was because my computer was part of a domain, and there was some sort of group policy for that domain was restricting the trusted root certificates that IIS would be willing to accept. 原来是因为我的计算机是域的一部分,并且该域的某种组策略限制了IIS愿意接受的受信任的根证书。 I don't know exactly what the setting was or how to alter it, but I found I could work around it by choosing to install my certificate into the enterprise physical store using the certutil command: 我不确切知道设置是什么或如何更改它,但我发现我可以使用certutil命令选择将证书安装到企业物理存储中来解决它:

certutil -addstore -v -enterprise root CertificateAuthority.cer

It sounds like the browser never prompted you to select a client certificate to send which means something is incorrect with the SSL Handshake. 听起来好像浏览器从未提示您选择要发送的客户端证书,这意味着SSL握手的内容不正确。 Try testing this with OpenSSL. 尝试使用OpenSSL进行测试。

Additionally, a very common problem is having too many certificates in the Trusted Root CA folder. 此外,一个非常常见的问题是在受信任的根CA文件夹中有太多证书。 When the server sends the list of CAs, there is a limit to how large the list can be so if it exceeds the limit, it will truncate the remaining CA certificates. 当服务器发送CA列表时,列表的大小有限,因此如果超过限制,它将截断剩余的CA证书。 Make sure the Trusted Root CA folder doesn't have too many certificates. 确保受信任的根CA文件夹没有太多证书。 One way to check this is temporarily modifying the SCHANNEL in the registry editor to not send the CA List, and then re-try. 检查此问题的一种方法是暂时修改注册表编辑器中的SCHANNEL以不发送CA列表,然后重试。

Start > Run > 'regedit' > HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL > right-click > New > DWORD > 'SendTrustedIssuerList' > Value:0 开始>运行>'regedit'> HKEY_LOCAL_MACHINE \\ SYSTEM \\ CurrentControlSet \\ Control \\ SecurityProviders \\ SCHANNEL>右键单击>新建> DWORD>'SendTrustedIssuerList'>值:0

I think I had this same issue getting internet explorer to actually create the prompt for my installed cert when testing a WCF client/server setup with self signed certs. 我认为在测试使用自签名证书的WCF客户端/服务器设置时,我有同样的问题让Internet Explorer实际创建我已安装的证书的提示。

If I recall correctly it was a setting in internet explorer, possibly this one... 如果我没记错的话,这是Internet Explorer中的一个设置,可能是这个...

Tools > Internet Options > Advanced tab > security section 工具> Internet选项>高级选项卡>安全性部分

Then clear the check boxes for: 然后清除以下复选框:

'Check for publisher's certificate revocation' and 'Check for server certificate revocation' '检查发布者的证书撤销'和'检查服务器证书撤销'

Re-install the certificates and check their effective dates. 重新安装证书并检查其生效日期。 From Microsoft Support : 来自Microsoft支持

  • Download the root server certificate in a browser on the server computer. 在服务器计算机上的浏览器中下载根服务器证书。 Run the Iisca.exe command line utility that is located in the Inetsrv directory. 运行位于Inetsrv目录中的Iisca.exe命令行实用程序。

  • Check the effective date on the client certificate and make sure that the date and time has arrived. 检查客户端证书上的生效日期,并确保日期和时间已到达。

  • Check the expiration date and make sure that the certificate has not expired. 检查到期日期并确保证书尚未过期。 Contact your certificate authority to see if your certificate has expired. 请与您的证书颁发机构联系,以查看您的证书是否已过期。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM