We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8687632 + f0c1e84 commit f027edfCopy full SHA for f027edf
hubblestack/files/hubblestack_nova/openssl.py
@@ -271,8 +271,8 @@ def _get_cert_from_file(cert_file_path):
271
def _get_x509_days_left(x509):
272
date_fmt = '%Y%m%d%H%M%SZ'
273
current_datetime = datetime.datetime.utcnow()
274
- not_after = time.strptime(x509.get_notAfter(), date_fmt)
275
- not_before = time.strptime(x509.get_notBefore(), date_fmt)
+ not_after = time.strptime(x509.get_notAfter().decode(), date_fmt)
+ not_before = time.strptime(x509.get_notBefore().decode(), date_fmt)
276
277
ret = {'not_after': (datetime.datetime(*not_after[:6]) - current_datetime).days,
278
'not_before': (datetime.datetime(*not_before[:6]) - current_datetime).days}
0 commit comments