Exemple #1
0
        private static void Main(string[] args)
        {
            try
            {
                CommandLineArguments = new CommandLineArguments();

                if (CommandLineArguments.CertificatePath == null)
                {
                    throw new Exception("No certificate file specified.");
                }

                if (CommandLineArguments.PrivateKeyPath == null)
                {
                    throw new Exception("No private key file specified.");
                }

                var certificate = Certification.CreateCertificateWithPrivateKey(CommandLineArguments.CertificatePath,
                                                                                CommandLineArguments.PrivateKeyPath);

                TLSServer.Run(certificate);
            }
            catch (Exception e)
            {
                ConsoleHelper.PrintException(e);

                Console.WriteLine("Press any key to exit...");
                Console.ReadKey();
            }
        }