From f6ef4335eda8ba075bb75239701f4ca9ea5600e5 Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Sat, 30 Nov 2019 17:00:18 +0100 Subject: [PATCH] Add `days_left' to context indicating how many days remain until certificate expiration --- ssl_checker.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ssl_checker.py b/ssl_checker.py index af39b0b..7762d49 100755 --- a/ssl_checker.py +++ b/ssl_checker.py @@ -136,6 +136,10 @@ def get_cert_info(host, cert): # Validity days context['validity_days'] = (valid_till - valid_from).days + # Validity in days from now + now = datetime.now() + context['days_left'] = (valid_till - now).days + return context