read client certificate from httprequest C#

后端 未结 4 1165
陌清茗
陌清茗 2021-02-03 11:26

I am trying to read an X509 certificate using Request.ClientCertificate but nothing is returned. The certificate is definitely being attached to the request because I can get th

4条回答
  •  一整个雨季
    2021-02-03 11:47

    Ok it isn't completely clear but you have a website which requires the clients to authenticate themselves using certificates? Because thats what the Request.ClientCertificate property is for.

    I say this because there's something odd about your question.

    "I can get the certificate information from the page sending the request."

    Pages in general do not really send requests the clients do.

    To get the server cert you could open the X509Store and sift through the certs to find the one with the CN you need.

提交回复
热议问题