在 IIS Express 上配置 TLS 版本

发布于 2025-01-13 19:59:29 字数 402 浏览 2 评论 0原文

我有一个使用可选证书身份验证的 .Net 6 Web api。我正在努力解决我的调试设置。

默认情况下,IIS Express 似乎不接受所提供的客户端证书,因此我编辑了 applicationhost.config 文件以包含

这意味着我的测试使用 powershell 通过客户端证书调用 API 是可行的,但是我现在失去了访问 Swagger 页面的能力,在尝试连接浏览器时收到 ERR_CONNECTION_RESET。

我在 IIS (full) 上遇到了类似的问题,并通过禁用 HTTP/2 和 HTTP/2 解决了它。 TLS1.3 - 是否可以在 IIS Express 中配置这样的东西?

I've got a .Net 6 web api that uses optional certificate authentication. I'm struggling with my debugging setup.

By default, IIS Express doesn't appear to take the client certificate presented, so I edited the applicationhost.config file to include

<access sslFlags="Ssl, SslNegotiateCert" />

This means my testing using powershell to call the API with a client certificate works, however I've now lost the ability to access the Swagger page, getting a ERR_CONNECTION_RESET when try to connect with a browser.

I had a similar issue on IIS (full) and resolved it by disabling HTTP/2 & TLS1.3 - is it possible to configure such a thing in IIS Express?

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

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

发布评论

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

评论(1

凤舞天涯 2025-01-20 19:59:29

好吧,我设法弄清楚了,调整来自 https://learn.microsoft.com/en-us/windows-server/identity/ad-fs/operations/manage-ssl-protocols-in-ad-fs 作为参考。

我在注册表中创建了以下两个项

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server] "Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server] "DisabledByDefault"=dword:00000001

registry 的屏幕截图

重新启动后,我可以使用证书身份验证和浏览器进行连接:)

Well, I managed to figure it out, adapting information from https://learn.microsoft.com/en-us/windows-server/identity/ad-fs/operations/manage-ssl-protocols-in-ad-fs as a reference.

I created the following two keys in the registry

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server] "Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server] "DisabledByDefault"=dword:00000001

screenshot of registry

And after a reboot, I'm able to connect using both certificate auth and my browser :)

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