Compare all timestamps in UTC timezone. (#309)

This commit is contained in:
Jean-Michel Picod
2021-04-15 17:22:54 +02:00
committed by GitHub
parent 748b7e7fb8
commit 5e682d9e17

View File

@@ -107,7 +107,7 @@ def main(args):
cert = x509.load_pem_x509_certificate(args.certificate.read()) cert = x509.load_pem_x509_certificate(args.certificate.read())
# Some sanity/validity checks # Some sanity/validity checks
now = datetime.datetime.now() now = datetime.datetime.utcnow()
if cert.not_valid_before > now: if cert.not_valid_before > now:
fatal("Certificate validity starts in the future.") fatal("Certificate validity starts in the future.")
if cert.not_valid_after <= now: if cert.not_valid_after <= now: