Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>How about we turn it into a programming question! You could use this code (C#), though I would recommend modifying it a bit (e.g. put url's in a file) and throwing it into a service.</p> <p>This code sets up a certificate validation callback which the HttpWebRequest will call anytime it encounters a certificate. This lets us take a look at the certificate, usually this is used to validate the cert but we are going to look at the expiration time and if it within 3 months we will send an email to ourselves. A timer is setup to run the check once a day.</p> <pre><code>using System.Net; using System.Diagnostics; using System.Net.Mail; using System.Threading; static void Main(string[] args) { // List of URL's to check string[] urls = new string[]{ "https://www.6bit.com/", "https://www.google.com/" }; HttpWebRequest req = null; // Certificate check callback ServicePointManager.ServerCertificateValidationCallback = (state, cert, certChain, sslerr) =&gt; { DateTime expiration = DateTime.Parse(cert.GetExpirationDateString()); if (expiration &lt; DateTime.Now.AddMonths(3)) { Debug.WriteLine("Cert expiring on " + expiration.ToShortDateString()); MailMessage msg = new MailMessage("SSLCheck@example.com", "josh@example.com", "SSL Certificate Expiring", "The ssl certificate for" + req.RequestUri.ToString() + " will expire on " + expiration.ToShortDateString()); SmtpClient sc = new SmtpClient(); sc.Send(msg); } return true; }; // Request each url once a day so that the validation callback runs for each Timer t = new Timer(s =&gt; { Array.ForEach(urls, url =&gt; { try { req = (HttpWebRequest)HttpWebRequest.Create(url); HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); resp.Close(); } catch (Exception ex) { Debug.WriteLine("Error checking site: " + ex.ToString()); } }); }, null, TimeSpan.FromSeconds(0), TimeSpan.FromDays(1)); // Run the timer now and schedule to run once a day } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload