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 {