使用 HttpModule 要求 IIS 中的客户端证书才能进行非本地网络请求

发布于 2024-08-03 19:12:17 字数 187 浏览 4 评论 0原文

对于并非源自本地网络的任何请求,我需要在 IIS 中的站点上要求客户端证书。任何本地请求都不应需要客户端证书。有没有办法在 IIS 中做到这一点?我正在考虑将 IIS 配置为允许但不要求客户端证书,然后使用自定义 HttpModule 来检查原始 IP 地址并回退任何非来自不包含客户端证书的本地网络的内容。

那行得通吗?你会如何解决这个问题?

I need to require client certificates on a site in IIS for any request that does not originate from the local network. Any local requests should not require client certificates. Is there a way to do this in IIS? I was thinking of configuring IIS to allow client certificates but not require them and then use a custom HttpModule that would check the originating IP address and kick back anything not from the local network that didn't include a client certificate.

Will that work? How would you solve the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

那小子欠揍 2024-08-10 19:12:17

我有几种方法可以解决这个问题。您可以选择您喜欢的内容:

  1. 复制该网站。其中一个应该要求客户端 SSL,而另一个则不需要。第二个应该禁用外部访问。

  2. 为本地计算机安装客户端 ssl。这可能是最简单的,除非您在获取客户端证书时遇到一些基础设施问题。

  3. 当 IIS 需要客户端 SSL 时,它会使用“需要客户端 ssl”类型消息来响应所有 HTTP 请求。然后,客户端(例如浏览器)通过传递所需的证书来更新其请求(例如显示证书的 IE 对话框)。您可以使用 HttpModule 来捕获本地请求的这些消息。

There are a couple of ways I would address this. You can pick what you like:

  1. duplicate the site. One should be requiring client SSL and other not. The second one should disable external access.

  2. install client ssl for local machines. This is perhaps the easiest unless you have some infrastructure issues getting client certificates.

  3. When IIS requires client SSL, it responds to all HTTP requests with a 'need client ssl' type message. The client (e.g. browser) then updates its request (e.g. show the IE dialog for cert) by passing the required certificates. You can use a HttpModule to trap these messages for local requests.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文