[英]Requirements to enforce TLS 1.2
應用程序托管在 Azure PAAS 上。 以下更改已經存在
為了確保我的應用程序的傳入和傳出請求符合 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.