/// <summary> /// Function to renew HTTPS certification. /// </summary> /// <param name="manipulator"><see cref="MySqlDataManipulator"/> used to add the company to the database</param> /// <remarks>As this is a command to be used by the developers on the project, error output is minimal</remarks> public override void PerformFunction(MySqlDataManipulator manipulator) { var server = ApiLoader.LoadApiAndListen(16384); Console.WriteLine("Attempting to retrieve new certificate"); CertificateRenewer.GetFirstCert(false); }
static void RenewCertificate() { try { Thread.Sleep(TimeSpan.FromMinutes(1)); while (true) { Console.WriteLine("Checking certificate status"); if (CertificateRenewer.CertificateNeedsRenewal()) { Console.WriteLine("Attempting to retrieve new certificate"); CertificateRenewer.GetFirstCert(false); } Thread.Sleep(TimeSpan.FromMinutes(30)); } } catch (ThreadInterruptedException) { Console.WriteLine("Certificate Renewal Thread Exiting"); } }