简体   繁体   English

实施 TLS 1.2 的要求

[英]Requirements to enforce TLS 1.2

Application is hosted on Azure PAAS.应用程序托管在 Azure PAAS 上。 The following changes are already present以下更改已经存在

  1. Azure app services TLS is set to 1.2, HTTPSOnly is set to off Azure 应用服务 TLS 设置为 1.2,HTTPSOnly 设置为关闭
  2. Service web config httpRuntime targetFramework is set to 4.7.1服务 web 配置 httpRuntime targetFramework 设置为 4.7.1

What else changes do I need to do to ensure incoming and outgoing requests of my application adhere to TLS 1 2.为了确保我的应用程序的传入和传出请求符合 TLS 1 2,我还需要做哪些更改。

Starting June 30 2018, all new apps in Azure App Service will be created with TLS 1.2 by default .从 2018 年 6 月 30 日开始,Azure 应用服务中的所有新应用都将默认使用TLS 1.2创建。

In the root of the website, find the global.asax file, right click on it and view code.在网站的根目录中,找到global.asax文件,右键单击它并查看代码。 In this file, there should be an Application_Start method.在这个文件中,应该有一个Application_Start方法。

In this method, add these lines to force TLS 1.2在此方法中,添加这些行以强制使用 TLS 1.2

protected void Application_Start()
{
    //**Add these lines**
    if (ServicePointManager.SecurityProtocol.HasFlag(SecurityProtocolType.Tls12) == false)
    {
         ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol | SecurityProtocolType.Tls12;
    }
    //**Add these lines**

    AreaRegistration.RegisterAllAreas();
    GlobalConfiguration.Configure(WebApiConfig.Register);
    FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
    RouteConfig.RegisterRoutes(RouteTable.Routes);
    BundleConfig.RegisterBundles(BundleTable.Bundles);
}

Also, you could enforce TLS version on Azure WebApps with Resource Manager Policies .此外,您可以使用Resource Manager Policies在 Azure WebApps 上强制实施 TLS 版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM