Skip to content

Commit

Permalink
Add tls 1.2 protocol support
Browse files Browse the repository at this point in the history
  • Loading branch information
trevis committed Jul 13, 2022
1 parent 1caeede commit fafd91b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
3 changes: 2 additions & 1 deletion PluginCore.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;

using System.Net;
using Decal.Adapter;
using MyClasses.MetaViewWrappers;

Expand Down Expand Up @@ -76,6 +76,7 @@ protected override void Startup()
{
try
{
ServicePointManager.SecurityProtocol = SecurityProtocolTypeExtensions.Tls12;
MVWireupHelper.WireupStart(this, Host);
}
catch (Exception ex)
Expand Down
21 changes: 21 additions & 0 deletions SSLProtocolExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace System.Net {
using System.Security.Authentication;
public static class SecurityProtocolTypeExtensions {
public const SecurityProtocolType Tls12 = (SecurityProtocolType)SslProtocolsExtensions.Tls12;
public const SecurityProtocolType Tls11 = (SecurityProtocolType)SslProtocolsExtensions.Tls11;
public const SecurityProtocolType SystemDefault = (SecurityProtocolType)0;
}
}

namespace System.Security.Authentication {
public static class SslProtocolsExtensions {
public const SslProtocols Tls12 = (SslProtocols)0x00000C00;
public const SslProtocols Tls11 = (SslProtocols)0x00000300;
}
}
5 changes: 3 additions & 2 deletions TownCrier.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TownCrier</RootNamespace>
<AssemblyName>TownCrier</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
Expand All @@ -39,7 +39,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Decal.Adapter">
<HintPath>..\..\..\..\Program Files (x86)\Decal 3.0\Decal.Adapter.dll</HintPath>
<HintPath>C:\Program Files (x86)\Decal 3.0\Decal.Adapter.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Decal.Interop.Core, Version=2.9.7.5, Culture=neutral, PublicKeyToken=481f17d392f1fb65, processorArchitecture=MSIL">
Expand Down Expand Up @@ -78,6 +78,7 @@
<Compile Include="Profile.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TimedTrigger.cs" />
<Compile Include="SSLProtocolExtensions.cs" />
<Compile Include="Utilities.cs" />
<Compile Include="VirindiViews\ViewSystemSelector.cs" />
<Compile Include="VirindiViews\Wrapper.cs" />
Expand Down

0 comments on commit fafd91b

Please sign in to comment.