electrum

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

commit 1cbc794229d368e78eaa5157468ac59132b0fbab
parent 06f18f90783b81b4014310760da4c7fa55f5d688
Author: ThomasV <thomasv@electrum.org>
Date:   Wed, 25 Oct 2017 17:43:30 +0200

interface: catch py3 exceptions

Diffstat:
Mlib/interface.py | 9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/interface.py b/lib/interface.py @@ -135,11 +135,12 @@ class TcpConnection(threading.Thread, util.PrintError): # try with CA first try: s = ssl.wrap_socket(s, ssl_version=ssl.PROTOCOL_TLSv1_1, cert_reqs=ssl.CERT_REQUIRED, ca_certs=ca_path, do_handshake_on_connect=True) - except socket.timeout: - return except ssl.SSLError as e: print_error(e) s = None + except: + return + if s and self.check_host_name(s.getpeercert(), self.host): self.print_error("SSL certificate signed by CA") return s @@ -150,11 +151,11 @@ class TcpConnection(threading.Thread, util.PrintError): return try: s = ssl.wrap_socket(s, ssl_version=ssl.PROTOCOL_TLSv1_1, cert_reqs=ssl.CERT_NONE, ca_certs=None) - except socket.timeout: - return except ssl.SSLError as e: self.print_error("SSL error retrieving SSL certificate:", e) return + except: + return dercert = s.getpeercert(True) s.close()