MaiDeveloper

#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>


Mike Mai
Mike Mai   Brooklyn, New York
I am a full-stack web developer. I love to learn cutting-edge technology and solve problems. I also like photography and graphic designs.