diff --git a/clients/report_tlscert b/clients/report_tlscert index a81633c..9806431 100755 --- a/clients/report_tlscert +++ b/clients/report_tlscert @@ -11,6 +11,7 @@ import time import requests ap = argparse.ArgumentParser() +ap.add_argument("--verbose", action="store_true") ap.add_argument("hostname") ap.add_argument("port", type=int, default=443, nargs="?") args = ap.parse_args() @@ -28,7 +29,8 @@ with socket.create_connection((args.hostname, args.port)) as sock: cert = ssock.getpeercert() not_after = ssl.cert_time_to_seconds(cert["notAfter"]) delta = not_after - now - except ssl.SSLCertVerificationError: + except ssl.SSLCertVerificationError as e: + print("got error %s; setting delta to 0", e) delta = 0 report0.append({ "measure": "tls_cert_ttl", "unit": "s", "value": delta })