aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol/tls.py
diff options
context:
space:
mode:
authorDavid Weinstein <dweinst@insitusec.com>2016-01-26 11:38:14 -0500
committerDavid Weinstein <dweinst@insitusec.com>2016-01-26 11:40:11 -0500
commit17a32d921cd2df98ad2f7861eb9165ec20dc7314 (patch)
tree1152d3779748b096c67cbcd156bfd2b5cf7b91bd /libmproxy/protocol/tls.py
parent11b289d3c7f8c0bae8ec2f570399fcc44675bdd8 (diff)
downloadmitmproxy-17a32d921cd2df98ad2f7861eb9165ec20dc7314.tar.gz
mitmproxy-17a32d921cd2df98ad2f7861eb9165ec20dc7314.tar.bz2
mitmproxy-17a32d921cd2df98ad2f7861eb9165ec20dc7314.zip
Log exceptions parsing TlsClientHello in TlsLayer
Diffstat (limited to 'libmproxy/protocol/tls.py')
-rw-r--r--libmproxy/protocol/tls.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/libmproxy/protocol/tls.py b/libmproxy/protocol/tls.py
index f05648ac..0b47af78 100644
--- a/libmproxy/protocol/tls.py
+++ b/libmproxy/protocol/tls.py
@@ -360,10 +360,13 @@ class TlsLayer(Layer):
"""
Peek into the connection, read the initial client hello and parse it to obtain ALPN values.
"""
- parsed = TlsClientHello.from_client_conn(self.client_conn)
- self.client_sni = parsed.client_sni
- self.client_alpn_protocols = parsed.client_alpn_protocols
- self.client_ciphers = parsed.client_cipher_suites
+ try:
+ parsed = TlsClientHello.from_client_conn(self.client_conn)
+ self.client_sni = parsed.client_sni
+ self.client_alpn_protocols = parsed.client_alpn_protocols
+ self.client_ciphers = parsed.client_cipher_suites
+ except TlsProtocolException as e:
+ self.log("Cannot parse Client Hello: %s" % repr(e), "error")
def connect(self):
if not self.server_conn: