From 816741ad8cf765201c2f549d3d2f79a2e628b58c Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Mon, 18 Sep 2017 00:25:13 -0400 Subject: [PATCH] Further sanity --- TGCommandLine/Program.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/TGCommandLine/Program.cs b/TGCommandLine/Program.cs index 9e00cf3df7..2f5967f724 100644 --- a/TGCommandLine/Program.cs +++ b/TGCommandLine/Program.cs @@ -113,12 +113,16 @@ namespace TGCommandLine return result; } + static bool AcceptedBadCert = false; static bool BadCertificateInteractive(string message) { + if (AcceptedBadCert) + return true; Console.WriteLine(message); Console.Write("Do you wish to continue? NOT RECCOMENDED! (y/N): "); var result = Console.ReadLine().Trim().ToLower(); - return result == "y" || result == "yes"; + AcceptedBadCert = result == "y" || result == "yes"; + return AcceptedBadCert; } static int Main(string[] args) @@ -169,11 +173,13 @@ namespace TGCommandLine { Console.WriteLine("Unable to connect: " + res); Server.MakeLocalConnection(); + AcceptedBadCert = false; } else if (!Server.Authenticate()) { Console.WriteLine("Authentication error: Username/password/windows identity is not authorized! Returning to local mode..."); Server.MakeLocalConnection(); + AcceptedBadCert = false; } else {