diff --git a/Program.cs b/Program.cs index f6df36f..2705c4c 100644 --- a/Program.cs +++ b/Program.cs @@ -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; diff --git a/dezentrale-members.csproj b/dezentrale-members.csproj index ef56b02..261e1ef 100644 --- a/dezentrale-members.csproj +++ b/dezentrale-members.csproj @@ -8,7 +8,7 @@ Exe dezentrale dezentrale-members - v4.5 + v4.8 512 true