Skip to content

Commit

Permalink
TLS1.1 obsolete in .NET70+
Browse files Browse the repository at this point in the history
  • Loading branch information
FanDjango committed Dec 25, 2024
1 parent 22b3e63 commit efb0665
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions FluentFTP/Model/FtpConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,11 @@ public bool SocketKeepAlive {
/// Encryption protocols to use. Only valid if EncryptionMode property is not equal to <see cref="FtpEncryptionMode.None"/>.
/// Default value is .NET Framework defaults from the <see cref="System.Net.Security.SslStream"/> class.
/// </summary>
#if NET7_0_OR_GREATER
public SslProtocols SslProtocols { get; set; } = SslProtocols.Tls12;
#else
public SslProtocols SslProtocols { get; set; } = SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls;
#endif

/// <summary>
/// Gets or sets the max number of socket write/read transactions
Expand Down
8 changes: 8 additions & 0 deletions FluentFTP/Model/Functions/FtpAutoDetectConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,19 @@ public class FtpAutoDetectConfig {
/// <summary>
/// List of protocols to be tried, and the order they should be tried in.
/// </summary>
#if NET7_0_OR_GREATER
public List<SysSslProtocols> ProtocolPriority { get; set; } = new List<SysSslProtocols> {
SysSslProtocols.Tls12,
// Do not EVER use "Default". It boils down to "SSL or TLS1.0" or worse.
// Do not use "None" - it can connect to TLS13, but Session Resume won't work, so a successful AutoDetect will be a false truth.
};
#else
public List<SysSslProtocols> ProtocolPriority { get; set; } = new List<SysSslProtocols> {
SysSslProtocols.Tls11 | SysSslProtocols.Tls12,
// Do not EVER use "Default". It boils down to "SSL or TLS1.0" or worse.
// Do not use "None" - it can connect to TLS13, but Session Resume won't work, so a successful AutoDetect will be a false truth.
};
#endif

}
}

0 comments on commit efb0665

Please sign in to comment.