Fix timezone mismatch in acm certificate created date and now date check

This commit is contained in:
Argishti Rostamian 2017-10-18 17:30:00 -07:00
parent b40c5e557e
commit 760f466a9c

View File

@ -170,7 +170,7 @@ class CertBundle(BaseModel):
try:
self._cert = cryptography.x509.load_pem_x509_certificate(self.cert, default_backend())
now = datetime.datetime.now()
now = datetime.datetime.utcnow()
if self._cert.not_valid_after < now:
raise AWSValidationException('The certificate has expired, is not valid.')