.net - Windows Server 2008 的 WebRequest 故障转移 TLS 1.1/1.2

标签 .net ssl

我正在运行一个 .net 4.5 应用程序,该应用程序向仅支持 TLS 1.1 和 TLS 1.2 的外部服务器发出安全出站请求。当我从 Windows 8/8.1 主机运行该应用程序时一切正常,但在 Windows Server 2008 上是失败: “底层连接已关闭:发送时发生意外错误。”

我相信 .net 依赖底层操作系统基础设施,并且由于 Windows Server 2008 不支持 TLS 1.1 和 TLS 1.2,WebRequest 也会失败。有人可以证实吗?有什么文件可以指点我吗?

代码示例:

var request = WebRequest.Create("https://SOMEURL");
using (var response = (HttpWebResponse) request.GetResponse())
{
    using (var responseStream = response.GetResponseStream())
    {
         // read the stream
    }
}

我也在设置支持的协议(protocol):

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

最佳答案

because Windows Server 2008 does not support TLS 1.1 and TLS 1.2 the WebRequest also fails.

是的,是这样的。

Any documentation to point me to?

来自 https://support.microsoft.com/en-us/kb/245030 :

Windows Server 2008 supports the following protocols:
 SSL 2.0
 SSL 3.0
 TLS 1.0

Windows Server 2008 R2 and Windows 7 support the following protocols:
 SSL 2.0
 SSL 3.0
 TLS 1.0
 TLS 1.1
 TLS 1.2

关于.net - Windows Server 2008 的 WebRequest 故障转移 TLS 1.1/1.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30479973/

相关文章:

c# - 更改 Action 对象实例的参数

MySql.ConnectorNET.Data 与 MySql.Data

c# - Asp.net c# - 检查文件是否存在失败

c# - 从 VSPackage 获取 Visual Studio 配色方案

c# - 无法传递字符串数组

ssl - 需要 IE/IIS 故障排除帮助

ssl - curl :(35)错误:1408F10B:SSL例程:ssl3_get_record:错误的版本号

python - 为 Python 2.6 添加 SSL 支持

linux - 如何在同一台服务器上混合使用基于 IP 和名称的虚拟主机?

java - 错误的 TLS 版本