.NET Core 3支持TLS 1.3吗?

5

我正在使用.NET Core 3.0制作一个仅支持TLS 1.3的代理,我看到SslProtocols中定义了Tls13 = 12288。但在我的测试过程中,它只会抛出“客户端和服务器无法通信,因为它们没有共同的算法”的异常。

所以我的问题是,.NET Core 3.0是否现在支持TLS 1.3?

我正在使用Visual Studio Professional 2019版本16.3.0预览版3.0,我的项目是netcore3.0。

Tls13 is defined in SslProtocols

//
// Summary:
//     Defines the possible versions of System.Security.Authentication.SslProtocols.
[Flags]
public enum SslProtocols {
    //
    // Summary:
    //     Allows the operating system to choose the best protocol to use, and to block
    //     protocols that are not secure. Unless your app has a specific reason not to,
    //     you should use this field.
    None = 0,
    //
    // Summary:
    //     Specifies the SSL 2.0 protocol. SSL 2.0 has been superseded by the TLS protocol
    //     and is provided for backward compatibility only.
    Ssl2 = 12,
    //
    // Summary:
    //     Specifies the SSL 3.0 protocol. SSL 3.0 has been superseded by the TLS protocol
    //     and is provided for backward compatibility only.
    Ssl3 = 48,
    //
    // Summary:
    //     Specifies the TLS 1.0 security protocol. The TLS protocol is defined in IETF
    //     RFC 2246.
    Tls = 192,
    //
    // Summary:
    //     Use None instead of Default. Default permits only the Secure Sockets Layer (SSL)
    //     3.0 or Transport Layer Security (TLS) 1.0 protocols to be negotiated, and those
    //     options are now considered obsolete. Consequently, Default is not allowed in
    //     many organizations. Despite the name of this field, System.Net.Security.SslStream
    //     does not use it as a default except under special circumstances.
    Default = 240,
    //
    // Summary:
    //     Specifies the TLS 1.1 security protocol. The TLS protocol is defined in IETF
    //     RFC 4346.
    Tls11 = 768,
    //
    // Summary:
    //     Specifies the TLS 1.2 security protocol. The TLS protocol is defined in IETF
    //     RFC 5246.
    Tls12 = 3072,
    //
    // Summary:
    //     Specifies the TLS 1.3 security protocol. The TLS protocol is defined in IETF
    //     RFC 8446.
    Tls13 = 12288
}

1
如果您能提供一个 [mcve],那将非常棒。 - mjwills
1个回答

4
我能够在线搜索到以下内容:
https://learn.microsoft.com/zh-cn/dotnet/core/whats-new/dotnet-core-3-0

TLS 1.3 和 OpenSSL 1.1.1 在 Linux .NET Core 上现在可以利用 TLS 1.1.1 提供的支持(在给定环境中可用)。使用 TLS 1.3,以下改进将会实现:

连接时间得到改善,客户端和服务器之间所需的往返次数减少。由于移除了各种过时和不安全的加密算法,安全性得到提高。当可用时,.NET Core 3.0 在 Linux 系统上将使用 OpenSSL 1.1.1、OpenSSL 1.1.0 或 OpenSSL 1.0.2。当 OpenSSL 1.1.1 可用时,System.Net.Security.SslStream 和 System.Net.Http.HttpClient 类型都将使用 TLS 1.3(假设客户端和服务器都支持 TLS 1.3)。


2
我认为你的意思是:是的,但只限于Linux...(或许在Mac上也可以),而绝对不适用于Windows。 - Stefan Steiger

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接