diff --git a/src/Launcher.cs b/src/Launcher.cs index a0a827c..bc669e6 100644 --- a/src/Launcher.cs +++ b/src/Launcher.cs @@ -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) { diff --git a/src/Misc/Helpers.cs b/src/Misc/Helpers.cs index 8804bf8..4dd5de2 100644 --- a/src/Misc/Helpers.cs +++ b/src/Misc/Helpers.cs @@ -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