Skip to content

Commit

Permalink
Probably going to fix Win2008R2 Telegram.Bot bug
Browse files Browse the repository at this point in the history
  • Loading branch information
UAVXP committed Nov 27, 2020
1 parent 246848d commit ef0501d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions MedocUpdates/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Windows.Forms;

using AppUpdater;
using System.Net;

namespace MedocUpdates
{
Expand All @@ -30,6 +31,21 @@ static void Main()
return;
}

// Fix for Telegram.Bot not being able to do something on Windows Server 2008 R2
try
{
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls |
SecurityProtocolType.Tls11 |
SecurityProtocolType.Tls12 |
SecurityProtocolType.Ssl3;
}
catch (Exception ex)
{
MessageBox.Show("MedocUpdates: Cannot set the security protocol type - TLS/TLS1.1/TLS1.2/SSL3 probably not supported\r\n" + ex.Message);
return;
}

ParsedArgs.SetArgs(Environment.GetCommandLineArgs());
ParsedArgs.PrintArgs();

Expand Down

0 comments on commit ef0501d

Please sign in to comment.