Skip to content

Commit

Permalink
Merge pull request #21 from versionone/D-16962
Browse files Browse the repository at this point in the history
D-16962 Configured to support TLS 1.1, 1.2 at Initialize.
  • Loading branch information
jallers authored Oct 21, 2020
2 parents caa4643 + 5f4002d commit dc4dc73
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions VersionOne.ServiceHost.Core/CommonMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Net;
using System.Reflection;
using System.Threading;
using Ninject;
Expand Down Expand Up @@ -38,6 +39,7 @@ public void Initialize()
Logger = new Logger(EventManager);
services = (IList<ServiceInfo>)ConfigurationManager.GetSection("Services");
profileStore = new XmlProfileStore("profile.xml");
ConfigureSecurityProtocolDefauts();
}

private void LogDiagnosticInformation()
Expand Down Expand Up @@ -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;
}
}
}

0 comments on commit dc4dc73

Please sign in to comment.