Apparently I have to set TLS 1.2 manually

This commit is contained in:
Rick Falkvinge
2019-12-29 10:54:06 +01:00
parent 07dc63e76a
commit 1e0db833f7
2 changed files with 8 additions and 1 deletions
+3
View File
@@ -57,6 +57,9 @@ namespace Swarmops.Backend
SystemSettings.BackendHostname = Dns.GetHostName();
// Force TLS 1.2 (why do I need to do this? The framework should enforce this)
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// Other one-time initializations
+5 -1
View File
@@ -1,6 +1,7 @@
<%@ Application Language="C#" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Web.ExtensionMethods" %>
<%@ Import Namespace="Swarmops.Database" %>
<%@ Import Namespace="Swarmops.Logic.Support" %>
@@ -11,11 +12,14 @@
private void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
SupportFunctions.OperatingTopology = OperatingTopology.FrontendWeb;
// Force TLS 1.2
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// Set supported cultures
HttpContext.Current.Application["Cultures"] = Formatting.SupportedCultures;
HttpContext.Current.Application["UserRoleCache"] = new Dictionary<int, string[]>();
SupportFunctions.OperatingTopology = OperatingTopology.FrontendWeb;
}
private void Application_End(object sender, EventArgs e)