Enforcing a minimum TLS version in the AWS SDK for .NET
To increase security when communicating with AWS services, you should configure the AWS SDK for .NET to use TLS 1.2 or later.
The AWS SDK for .NET uses the underlying .NET runtime to determine which security protocol to use. By default, current versions of .NET use the latest configured protocol that the operating system supports. Your application can override this SDK behavior, but it's not recommended to do so.
.NET Core
By default, .NET Core uses the latest configured protocol that the operating system supports. The AWS SDK for .NET doesn't provide a mechanism to override this.
If you're using a .NET Core version earlier than 2.1, we strongly recommend you upgrade your .NET Core version.
See the following for information specific to each operating system.
Windows
Modern distributions of Windows have TLS 1.2 support enabled by default
macOS
If you're running .NET Core 2.1 or later, TLS 1.2 is enabled by default. TLS 1.2 is supported by
OS X Mavericks v10.9 or later
If you're using .NET Core 1.0, .NET Core uses OpenSSL on macOS
Linux
.NET Core on Linux requires OpenSSL, which comes bundled with many Linux distributions. But it can also be installed separately. OpenSSL added support for TLS 1.2 in version 1.0.1, and added support for TLS 1.3 in version 1.1.1. If you're using a modern version of .NET Core (2.1 or later) and have installed a package manager, it's likely that a more modern version of OpenSSL was installed for you.
To be sure, you can run openssl version
in a terminal
and verify that the version is later than 1.0.1.
.NET Framework
If you're running a modern version of .NET Framework (4.7 or later) and a modern version of Windows (at least Windows 8 for clients, Windows Server 2012 or later for servers), TLS 1.2 is enabled and used by default.
If you're using a .NET Framework runtime that doesn't use the operating system settings (.NET
Framework 3.5 through 4.5.2), the AWS SDK for .NET will attempt to add support for TLS 1.1 and TLS 1.2
Warning
Starting August 15th, 2024, the AWS SDK for .NET will end support for .NET Framework 3.5 and will change
the minimum .NET Framework version to 4.7.2. For more information, see the blog post Important changes coming for .NET Framework 3.5 and 4.5 targets of the AWS SDK for .NET
If your application is running on a newer .NET Framework on Windows 7 SP1 or Windows Server 2008 R2
SP1, you need to ensure that TLS 1.2 support is enabled in the registry, as described at https://learn.microsoft.com/en-us/windows-server/security/tls/tls-registry-settings#tls-12
For detailed best practices for using TLS with .NET Framework, see the Microsoft article at https://learn.microsoft.com/en-us/dotnet/framework/network-programming/tls
AWS Tools for PowerShell
AWS Tools for PowerShell use the AWS SDK for .NET for all calls to AWS services. The behavior of your environment depends on the version of Windows PowerShell you're running, as follows.
Windows PowerShell 2.0 through 5.x
Windows PowerShell 2.0 through 5.x run on .NET Framework. You can verify which .NET runtime (2.0 or 4.0) is being used by PowerShell by using the following command.
$PSVersionTable.CLRVersion
-
When using .NET Runtime 2.0, follow the instructions provided earlier regarding the AWS SDK for .NET and .NET Framework 3.5.
Warning
Starting August 15th, 2024, the AWS SDK for .NET will end support for .NET Framework 3.5 and will change the minimum .NET Framework version to 4.7.2. For more information, see the blog post Important changes coming for .NET Framework 3.5 and 4.5 targets of the AWS SDK for .NET
. -
When using .NET Runtime 4.0, follow the instructions provided earlier regarding the AWS SDK for .NET and .NET Framework 4+.
Windows PowerShell 6.0
Windows PowerShell 6.0 and newer run on .NET Core. You can verify which version of .NET Core is being used by running the following command.
[System.Reflection.Assembly]::GetEntryAssembly().GetCustomAttributes([System.Runtime.Versioning.TargetFrameworkAttribute], $true).FrameworkName
Follow the instructions provided earlier regarding the AWS SDK for .NET and the relevant version of .NET Core.
Xamarin
For Xamarin, see the directions at https://learn.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/transport-layer-security
For Android
-
Requires Android 5.0 or later.
-
Project Properties, Android Options: HttpClient implementation must be set to Android and the SSL/TLS implementation set to Native TLS 1.2+.
For iOS
-
Requires iOS 7 or later.
-
Project Properties, iOS Build: HttpClient implementation must be set to NSUrlSession.
For macOS
-
Requires macOS 10.9 or later.
-
Project Options, Build, Mac Build: HttpClient implementation must be set to NSUrlSession.
Unity
You must use Unity 2018.2 or later, and use the .NET 4.x Equivalent scripting runtime. You can set
this in Project Settings, Configuration,
Player, as described at https://docs.unity3d.com/2019.1/Documentation/Manual/ScriptingRuntimeUpgrade.html
Browser (for Blazor WebAssembly)
WebAssembly runs in the browser instead of on the server, and uses the browser for handling HTTP traffic. Therefore, TLS support is determined by browser support.
Blazor WebAssembly, in preview for ASP.NET Core 3.1, is supported only in browsers that support
WebAssembly, as described at https://learn.microsoft.com/en-us/aspnet/core/blazor/supported-platforms
See your browser's documentation for more information and verification.