Fixes #4166 - Outgoing connections sometimes fail because they require TLS 1.2

This commit is contained in:
Sebastiaan Janssen
2019-01-21 11:09:13 +01:00
parent e1c9b1818e
commit ba4b84d7f4

View File

@@ -4,6 +4,7 @@ using System.Collections.Specialized;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Configuration;
using System.Web.Http;
@@ -130,6 +131,10 @@ namespace Umbraco.Web
InstallHelper insHelper = new InstallHelper(UmbracoContext.Current);
insHelper.DeleteLegacyInstaller();
// Tell .net 4.5 that we also want to try connecting over TLS 1.2, not just 1.1
if (ServicePointManager.SecurityProtocol.HasFlag(SecurityProtocolType.Tls12) == false)
ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol | SecurityProtocolType.Tls12;
return this;
}