我已经设置了一个 IIS 服务器来要求客户端证书。但是浏览器从不询问用户,即使 IE 启用了“不提示选择客户端证书...”,它也会直接发送客户端证书信息
我的代码或 IIS 有什么可做的吗?
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Welcome.Text = "Hello, " + Context.User.Identity.Name;
string userName;
userName = User.Identity.Name;
HttpClientCertificate cert = Request.ClientCertificate;
if (cert.IsPresent)
certDataLabel.Text = cert.Issuer;
else
certDataLabel.Text = "No certificate was found.";
}
protected void Signout_Click(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
Response.Redirect("Logon.aspx");
}
}