Overview

If your website uses a version of ASP.NET that is below version 4.8 or if your website does not enforce TLS 1.2 in it’s code base, you may have trouble accessing external services or APIs. This is because Conetix servers support TLS 1.2 only.

This article serves as a generic guide on how to resolve TLS 1.2 issues for ASP.NET.

Solution #1

From ASP.NET 4.6.2 TLS 1.2 is supported and can be enforced with the below C# code.

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

Place this before your outbound HTTP request.

Solution #2

ASP.NET 4.8 and up default to TLS 1.2, you can modify your web.config <system.web> area to target the ASP.NET 4.8 framework:

<system.web>
  <compilation debug="false" targetFramework="4.8" />
  <httpRuntime targetFramework="4.8" />
</system.web>

Possible Errors

Bellow are possible errors that may present due to TLS 1.2 not being supported by your site or web application.

  • System.Net.Mail.SmtpException: Failure sending mail. ---> System.IO.IOException: The handshake failed due to an unexpected packet format
  • The request was aborted: Could not create SSL/TLS secure channel

Was this article helpful?

Related Articles