首页 > 解决方案 > 如何在 IIS 中为特定 URL 的所有请求要求双向 TLS

问题描述

对于 Mutual TLS (MTLS),Identity Server 4文档说 Identity Server 在某些端点被配置为 MTLS。

在 IdentityServer 中,双向 TLS 端点应该位于路径 ~/connect/mtls 之下。这意味着您的 Web 服务器可以配置为对该路径上和该路径下的所有请求都需要双向 TLS。

有没有办法在 IIS 中做到这一点?我一直在广泛研究,但找不到为特定端点启用 MTLS 的方法。

标签: ssliisidentityserver4x509certificatetls1.2

解决方案


如果您在 ApplicationHost.config 中设置相关节点的读/写权限,您可以在 web.config 中进行设置:

<configuration>
    ...
    <location path="connect/mtls">
        <system.webServer>
            <security>
                <access sslFlags="Ssl, SslNegotiateCert, SslRequireCert" />
            </security>
        </system.webServer>
    </location>
    ...
</configuration>

/汉斯


推荐阅读