From 1e0db833f7f46bde044cd4c833c5069c98a248d2 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sun, 29 Dec 2019 10:54:06 +0100 Subject: [PATCH] Apparently I have to set TLS 1.2 manually --- Backend/BackendLoop.cs | 3 +++ Site/Global.asax | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Backend/BackendLoop.cs b/Backend/BackendLoop.cs index 679179c8..7249f158 100644 --- a/Backend/BackendLoop.cs +++ b/Backend/BackendLoop.cs @@ -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 diff --git a/Site/Global.asax b/Site/Global.asax index cf50f662..5448cb49 100644 --- a/Site/Global.asax +++ b/Site/Global.asax @@ -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(); - SupportFunctions.OperatingTopology = OperatingTopology.FrontendWeb; } private void Application_End(object sender, EventArgs e)