Also print when a server is successfully validated.

This commit is contained in:
Fabian
2023-07-16 19:23:18 +02:00
parent ca332be631
commit 3df4f47f50
2 changed files with 9 additions and 2 deletions

View File

@@ -124,7 +124,14 @@ static class Launcher
(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) =>
{
if (sslPolicyErrors == SslPolicyErrors.None)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine($"Certificate for server '{portal.HostName}' successfully validated.");
Console.WriteLine();
Console.ResetColor();
return true;
}
// Redirect to the trusted cert warning.
throw new AuthenticationException();
@@ -132,7 +139,7 @@ static class Launcher
null
);
sslStream.AuthenticateAsClient("portal.HostName");
sslStream.AuthenticateAsClient(portal.HostName);
}
catch (SocketException)
{

View File

@@ -68,7 +68,7 @@ static class Helpers
var portalSpan = config.AsSpan(startQuoteIndex + 1, portalLength);
var colonIndex = portalSpan.IndexOf(':');
var ipSpan = colonIndex != -1 ? portalSpan[..colonIndex] : portalSpan;
var port = colonIndex != -1 ? int.Parse(portalSpan[colonIndex..]) : 1119;
var port = colonIndex != -1 ? int.Parse(portalSpan[(colonIndex + 1)..]) : 1119;
var portalString = ipSpan.ToString().Trim();
try