prosodyctl: check certs: Warn about certificate expiry in the near future
authorKim Alvefur <zash@zash.se>
Sun, 28 Feb 2016 17:24:12 +0000 (18:24 +0100)
committerKim Alvefur <zash@zash.se>
Sun, 28 Feb 2016 17:24:12 +0000 (18:24 +0100)
prosodyctl

index 4ae1136c75c01cb1d631a96c0e30817f18eba6b9..de397ccf930d08e89d07eb3f73d88c40362c54fd 100755 (executable)
@@ -1243,6 +1243,13 @@ function commands.check(arg)
                                                if not cert:validat(os.time()) then
                                                        print("    Certificate has expired.")
                                                        cert_ok = false
+                                               elseif not cert:validat(os.time() + 86400) then
+                                                       print("    Certificate expires within one day.")
+                                                       cert_ok = false
+                                               elseif not cert:validat(os.time() + 86400*7) then
+                                                       print("    Certificate expires within one week.")
+                                               elseif not cert:validat(os.time() + 86400*13) then
+                                                       print("    Certificate expires within one month.")
                                                end
                                                if config.get(host, "component_module") == nil
                                                        and not x509_verify_identity(host, "_xmpp-client", cert) then