我有一个读取用户 CAC 卡的 ASP.NET 网页。发布到测试服务器时,它工作正常;但是,在使用 IIS Express 的本地开发环境中,使用 Request.ServerVariables("CERT_SUBJECT") 时会得到空字符串。我能够检索“LOGON_USER”变量,但“CERT_*”都是空字符串。
目前我的项目设置包含
Anonymous Authentication = false
Windows Authentication = true
SSL Enabled = true // Created the default IIS express cert. Have also tried false with no luck
此外,我还尝试像这样修改 applicationhost.config
<security>
<access sslFlags="SslRequireCert"> <!-- originally none -->
</security>
<authentication>
<anonymousAuthentication enabled="false" userName="" /> <!--originally true-->
<basicAuthentication enabled="false" />
<clientCertificateMappingAuthentication enabled="false" />
<digestAuthentication enabled="false" />
<iisClientCertificateMappingAuthentication enabled="true"> <!--originally false-->
</iisClientCertificateMappingAuthentication>
<windowsAuthentication enabled="true"> <!--originally false-->
<providers>
<add value="Negotiate" />
<add value="NTLM" />
</providers>
</windowsAuthentication>
</authentication>
关于我需要进行进一步配置以允许我的开发环境在调试期间看到这些变量的任何想法?谢谢。