问题描述
我在支持HTTPS使用.NET编写了一个Web服务器的 SslStream
。
I wrote a webserver in .NET that supports HTTPS by using an SslStream
.
不幸的是,ssllabs.com输出以下消息对我实施:
Unfortunately, ssllabs.com outputs the following message about my implementation:
本服务器很容易受到MITM攻击,因为它支持不安全的重新谈判。
这个链接到一个有趣的博客条目有关漏洞。
我如何禁用重新谈判.NET的 SslStream
?
How do I disable renegotiation in .NET’s SslStream
?
推荐答案
SslStream使用的Schannel.dll引擎盖下。您可以配置哪些算法可通过修改注册表:
SslStream uses SChannel.dll under the hood. You can configure which algorithms are available by modifying the registry:
http://support.microsoft.com/kb/245030
在特定的,这两个项目在下面的截图强调将禁止TLS重新协商:
In particular, the two entries highlighted in the following screenshot will disallow TLS renegotiation:
他们被称为 AllowInsecureRenegoClients
和 AllowInsecureRenegoServers
,都是DWORD值,均设置为0,并位于 HKEY_LOCAL_MACHINE \系统\ CurrentControlSet \控制\ SecurityProviders \ SCHANNEL
。
They are called AllowInsecureRenegoClients
and AllowInsecureRenegoServers
, are both DWORD values, both set to 0, and located in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL
.
显然有可以安装修补程序做禁用不安全的TLS / SSL重新协商太(只适用于Windows XP / Windows2003的服务器):
Apparently there is a hotfix you can install do disable insecure TLS/SSL renegotiation too (only applicable to Windows XP/Windows2003 server):
http://support.microsoft.com/kb/980436/en-us
这篇关于禁用不安全的重新谈判中SslStream的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!