View a markdown version of this page

Enforcing a minimum TLS version in the Amazon SDK for .NET - Amazon SDK for .NET (V4)
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Version 4 (V4) of the Amazon SDK for .NET has been released!

For information about breaking changes and migrating your applications, see the migration topic.

Orange button with text "Click here for details".

Enforcing a minimum TLS version in the Amazon SDK for .NET

To increase security when communicating with Amazon services, you should configure the Amazon SDK for .NET to use TLS 1.2 or later.

The Amazon 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.

TLS 1.3 is the prerequisite to enable post-quantum cryptography, which may require additional actions or configurations. To learn more, see Enabling hybrid post-quantum TLS in the Amazon SDKs and Tools Reference Guide.

.NET 8 and later

By default, .NET uses the latest configured protocol that the operating system supports. The Amazon SDK for .NET doesn't provide a mechanism to override this.

If you're using a version of .NET that Microsoft no longer supports, upgrade to a supported version. For the versions that the SDK provides builds for, see Supported platforms.

See the following for information specific to each operating system.

Windows

Modern distributions of Windows have TLS 1.2 support enabled by default. If you're running 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. If you're running an earlier distribution, you must upgrade your operating system. For information about TLS 1.3 support in Windows, check the latest Microsoft documentation for the minimum required client or server versions.

macOS

.NET enables TLS 1.2 by default on macOS. For the versions of macOS that each version of .NET supports, see Install .NET on macOS on the Microsoft Learn website.

Linux

.NET 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 installed .NET with a package manager, the package manager likely installed a modern version of OpenSSL 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 Amazon SDK for .NET will attempt to add support for TLS 1.1 and TLS 1.2 to the supported protocols. If you're using .NET Framework 3.5, this will be successful only if the appropriate hot patch is installed, as follows:

  • Windows 10 version 1511 and Windows Server 2016 – KB3156421

  • Windows 8.1 and Windows Server 2012 R2 – KB3154520

  • Windows Server 2012 – KB3154519

  • Windows 7 SP1 and Server 2008 R2 SP1 – KB3154518

Warning

On August 15th, 2024, the Amazon SDK for .NET ended support for .NET Framework 3.5 and changed 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 Amazon 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. Newer versions of Windows have it enabled by default.

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.

Amazon Tools for PowerShell

Amazon Tools for PowerShell use the Amazon SDK for .NET for all calls to Amazon 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 Amazon SDK for .NET and .NET Framework 3.5.

    Warning

    On August 15th, 2024, the Amazon SDK for .NET ended support for .NET Framework 3.5 and changed 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 Amazon SDK for .NET.

  • When using .NET Runtime 4.0, follow the instructions provided earlier regarding the Amazon SDK for .NET and .NET Framework 4+.

Windows PowerShell 6.0

PowerShell 6.0 and newer run on .NET. You can verify which version of .NET 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 Amazon SDK for .NET and the relevant version of .NET.

Xamarin

For Xamarin, see the directions at https://learn.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/transport-layer-security. In summary:

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. The .NET 4.x Equivalent scripting runtime enables TLS 1.2 support to all Unity platforms running Mono or IL2CPP.

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 is supported only in browsers that support WebAssembly, as described at https://learn.microsoft.com/en-us/aspnet/core/blazor/supported-platforms. All mainstream browsers supported TLS 1.2 before supporting WebAssembly. If this is the case for your browser, then if your app runs, it can communicate over TLS 1.2.

See your browser's documentation for more information and verification.