electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 7bea1cce1fbb0e0a502288b381ce12fbc1e93dd7
parent 7584cebbe32055a2455d448b436c7af470428e2a
Author: SomberNight <somber.night@protonmail.com>
Date:   Fri, 26 Apr 2019 01:55:58 +0200

x509: show cert expiration date in error

related #5292

Diffstat:
Melectrum/x509.py | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/electrum/x509.py b/electrum/x509.py @@ -25,6 +25,7 @@ import hashlib import time +from datetime import datetime import ecdsa @@ -304,7 +305,8 @@ class X509(object): if self.notBefore > now: raise CertificateError('Certificate has not entered its valid date range. (%s)' % self.get_common_name()) if self.notAfter <= now: - raise CertificateError('Certificate has expired. (%s)' % self.get_common_name()) + dt = datetime.utcfromtimestamp(time.mktime(self.notAfter)) + raise CertificateError(f'Certificate ({self.get_common_name()}) has expired (at {dt} UTC).') def getFingerprint(self): return hashlib.sha1(self.bytes).digest()