可以客户端证书设置在web.config配置 [英] Can Client certificate settings be configured in the web.config

查看:171
本文介绍了可以客户端证书设置在web.config配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用SSL的应用程序工作,我想控制哪些文件夹忽略,要求或接受客户端的认证。

I'm working with an SSL application and am wanting to control which folders ignore, require or accept client certifications.

我们的最终目标是让Web应用程序的子文件夹忽略客户端认证。我不想通过IIS来做到这一点,因为它会在整个Web场被复制。

The end goal is to have a sub-folder of the webApp ignore client certification. I do not want to do this via IIS because it will have to be replicated across the entire web farm.

任何想法?

推荐答案

您可以使用访问部分和(在适当的子目录或web.configs)在web.config中的位置来进行配置。

You can use a combination of the access section and locations in web.config (or web.configs in the appropriate subdirectories) to configure this.

例如,需要在目录界面的SSL证书,可以在以下块添加到你的web.config配置部分:

For example, to require an SSL certificate in the directory Interface, you can add the following block to your web.config's configuration section:

  <location path="Interface">
    <system.webServer>
      <security>
        <access sslFlags="Ssl,SslRequireCert" />
      </security>
    </system.webServer>
  </location>

请注意,如果你想要求SSL,则必须添加它和相应的证书标志。

Note that if you want to require Ssl, you have to add it and the appropriate certificate flag.

从TechNet文档的标志值是:

The flag values from the technet documentation are:

无。此默认设置为关闭站点或应用程序SSL。

None. This default setting disables SSL for the site or application.

SSL。该网站或应用程序需要使用SSL。

Ssl. The site or application requires SSL.

SslNegotiateCert。该网站或应用程序接受客户端证书进行身份验证。

SslNegotiateCert. The site or application accepts client certificates for authentication.

SslRequireCert。该网站或应用程序需要进行身份验证客户端证书。
      SSL128。该网站或应用程序需要128位SSL证书加密。

SslRequireCert. The site or application requires client certificates for authentication. Ssl128. The site or application requires 128-bit SSL certificate encryption.

访问部分不能被默认覆盖。

The access section cannot be overriden by default.

为了支持这一点,你必须修改的applicationHost.config在C:\\ WINDOWS \\ SYSTEM32 \\ INETSRV \\ CONFIG(或您的安装相应的目录),并更改以下行:

In order to support this, you must modify applicationHost.config in C:\Windows\System32\inetsrv\config (or appropriate directory for your install) and change the following line:

<section name="access" overrideModeDefault="Deny" />

<section name="access" overrideModeDefault="Allow" />

这篇关于可以客户端证书设置在web.config配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆