How to send client certificate using HttpWebRequest and IISExpress for debugging

谁说胖子不能爱 提交于 2019-12-04 10:04:41

You need to specify parameters in the config file for the IIS Express instance, located at
C:\Users\[username]\Documents\IISExpress\config\applicationhost.config

You should look for the security element.

The element controls whether the IIS server would accept client certificates. Setting the attribute enabled to true does this:

iisClientCertificateMappingAuthentication enabled="true"

The access element controls how to handle access. The sslFlags attribute controls how the client certificate would be treated. For some reason, the only way I've got the IIS to actually pass a certificate to the request is by setting the sslFlags to the value SslNegotiateCert as:

access sslFlags="SslNegotiateCert"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!