May 26, 2019 · Tutorial ASP.NET

How to change security protocol to tls1.2 in IIS/ASP.NET?

Edit Global.asax file. Import the System.Net class and then change the security protocol to tls1.2 in the Applicatin_Start method.

<%@ Application Language="C#" %>

<%@ Import Namespace="System.Net" %>

<script runat="server">
    void Application_Start(object sender, EventArgs e)
    {
        // Enforce the security protocol to TLS 1.2
        ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
    }
</script>



Comments powered by Disqus