簡體   English   中英

實施 TLS 1.2 的要求

[英]Requirements to enforce TLS 1.2

應用程序托管在 Azure PAAS 上。 以下更改已經存在

  1. Azure 應用服務 TLS 設置為 1.2,HTTPSOnly 設置為關閉
  2. 服務 web 配置 httpRuntime targetFramework 設置為 4.7.1

為了確保我的應用程序的傳入和傳出請求符合 TLS 1 2,我還需要做哪些更改。

從 2018 年 6 月 30 日開始,Azure 應用服務中的所有新應用都將默認使用TLS 1.2創建。

在網站的根目錄中,找到global.asax文件,右鍵單擊它並查看代碼。 在這個文件中,應該有一個Application_Start方法。

在此方法中,添加這些行以強制使用 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);
}

此外,您可以使用Resource Manager Policies在 Azure WebApps 上強制實施 TLS 版本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM