aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/tcp.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2013-08-10 23:07:09 +1200
committerAldo Cortesi <aldo@nullcube.com>2013-08-10 23:07:09 +1200
commitb9f06b473cd464e82bc53a973c5e190f93377bce (patch)
treeb686464157825acb188464947f10b469b88c864c /netlib/tcp.py
parentf5fdfd8a9f17e0fe213a9cf54acae84e4bc31462 (diff)
downloadmitmproxy-b9f06b473cd464e82bc53a973c5e190f93377bce.tar.gz
mitmproxy-b9f06b473cd464e82bc53a973c5e190f93377bce.tar.bz2
mitmproxy-b9f06b473cd464e82bc53a973c5e190f93377bce.zip
Better handling of cert errors.
Diffstat (limited to 'netlib/tcp.py')
-rw-r--r--netlib/tcp.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/netlib/tcp.py b/netlib/tcp.py
index 123c6515..df1f8fea 100644
--- a/netlib/tcp.py
+++ b/netlib/tcp.py
@@ -37,6 +37,7 @@ OP_TLS_ROLLBACK_BUG = SSL.OP_TLS_ROLLBACK_BUG
class NetLibError(Exception): pass
class NetLibDisconnect(NetLibError): pass
class NetLibTimeout(NetLibError): pass
+class NetLibSSLError(NetLibError): pass
class _FileLike:
@@ -129,6 +130,8 @@ class Reader(_FileLike):
data = self.o.read(rlen)
except SSL.ZeroReturnError:
break
+ except SSL.Error, v:
+ raise NetLibSSLError(v.message)
except SSL.WantReadError:
if (time.time() - start) < self.o.gettimeout():
time.sleep(0.1)