tfix: dePem cert before parsing - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 85d9b8aa8dadac5e1d7f305b1258f9550c743b9f DIR parent ca3c320ef42839f373ff1f9e00d6756a444419d7 HTML Author: ThomasV <thomasv@gitorious> Date: Fri, 7 Aug 2015 11:58:59 +0200 fix: dePem cert before parsing Diffstat: M lib/interface.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- DIR diff --git a/lib/interface.py b/lib/interface.py t@@ -27,6 +27,7 @@ ca_path = requests.certs.where() import util import x509 +import pem from version import ELECTRUM_VERSION, PROTOCOL_VERSION from simple_config import SimpleConfig t@@ -201,7 +202,8 @@ class TcpInterface(threading.Thread): with open(cert_path) as f: cert = f.read() try: - x = x509.X509(cert) + b = pem.dePem(cert, 'CERTIFICATE') + x = x509.X509(b) except: traceback.print_exc(file=sys.stderr) self.print_error("wrong certificate") t@@ -342,7 +344,8 @@ def check_host_name(peercert, name): def check_cert(host, cert): try: - x = x509.X509(cert) + b = pem.dePem(cert, 'CERTIFICATE') + x = x509.X509(b) except: traceback.print_exc(file=sys.stdout) return