2023-04-06 Added workaround draft for Mail+TLS1.0, still not working

Increased framework version to 4.8
This commit is contained in:
phantomix 2023-04-06 10:46:23 +02:00
parent 0cda515187
commit 86f6ad9739
2 changed files with 18 additions and 2 deletions

View File

@ -138,7 +138,23 @@ namespace dezentrale
{
bool printHelp = false;
Console.WriteLine($"dezentrale-members, Version {VersionString}");
Console.WriteLine($"Working directory: {DmDirectory}");
Console.WriteLine($"Working directory: {DmDirectory}");
//See https://stackoverflow.com/questions/721161/how-to-detect-which-net-runtime-is-being-used-ms-vs-mono
bool isRunningOnMono = false;
try
{
isRunningOnMono = (Type.GetType("Mono.Runtime") != null);
} catch(Exception ex) { Console.WriteLine($"Mono detection failed. Assuming non-Mono. Error: {ex.Message}"); }
if(isRunningOnMono)
{
//Mono on OpenSSL (boringssl) will lead to Usage of TLS 1.0 instead of 1.2, even
//if this is explicitly set here!
Console.WriteLine("Mono detected. Setting MONO_TLS_PROVIDER to btls");
Environment.SetEnvironmentVariable("MONO_TLS_PROVIDER", "btls");
}
System.Net.ServicePointManager.Expect100Continue = true;
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

View File

@ -8,7 +8,7 @@
<OutputType>Exe</OutputType>
<RootNamespace>dezentrale</RootNamespace>
<AssemblyName>dezentrale-members</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />