Further sanity

This commit is contained in:
Cyberboss
2017-09-18 00:25:13 -04:00
parent a7d8d58f2b
commit 816741ad8c
+7 -1
View File
@@ -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
{