diff --git a/VersionOne.ServiceHost.Core/CommonMode.cs b/VersionOne.ServiceHost.Core/CommonMode.cs index f568605..c39e78d 100644 --- a/VersionOne.ServiceHost.Core/CommonMode.cs +++ b/VersionOne.ServiceHost.Core/CommonMode.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Configuration; +using System.Net; using System.Reflection; using System.Threading; using Ninject; @@ -38,6 +39,7 @@ public void Initialize() Logger = new Logger(EventManager); services = (IList)ConfigurationManager.GetSection("Services"); profileStore = new XmlProfileStore("profile.xml"); + ConfigureSecurityProtocolDefauts(); } private void LogDiagnosticInformation() @@ -107,5 +109,12 @@ private void FlushProfileImpl(object o) { profileStore.Flush(); } + + private void ConfigureSecurityProtocolDefauts() + { + SecurityProtocolType updatedType = ServicePointManager.SecurityProtocol & ~(SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls); + if (ServicePointManager.SecurityProtocol != updatedType) + ServicePointManager.SecurityProtocol = updatedType | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; + } } } \ No newline at end of file