From dd414e485212e3cab612a66d5d858c1a766ace04 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Fri, 11 Sep 2015 02:17:04 +0200 Subject: better error messages, remove error cause --- libmproxy/protocol/tls.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'libmproxy/protocol/tls.py') diff --git a/libmproxy/protocol/tls.py b/libmproxy/protocol/tls.py index 1164681c..4f7c9300 100644 --- a/libmproxy/protocol/tls.py +++ b/libmproxy/protocol/tls.py @@ -416,7 +416,12 @@ class TlsLayer(Layer): except NetLibError as e: six.reraise( ClientHandshakeException, - ClientHandshakeException("Cannot establish TLS with client: %s" % repr(e), e), + ClientHandshakeException( + "Cannot establish TLS with client (sni: {sni}): {e}".format( + sni=self.client_sni, e=repr(e) + ), + self.client_sni or repr(self.server_conn.address) + ), sys.exc_info()[2] ) @@ -473,7 +478,7 @@ class TlsLayer(Layer): address=repr(self.server_conn.address), sni=self.sni_for_server_connection, e=repr(e), - ), e), + )), sys.exc_info()[2] ) except NetLibError as e: @@ -483,7 +488,7 @@ class TlsLayer(Layer): address=repr(self.server_conn.address), sni=self.sni_for_server_connection, e=repr(e), - ), e), + )), sys.exc_info()[2] ) -- cgit v1.2.3