diff options
author | chhsiao90 <chhsiao90@gmail.com> | 2016-10-25 09:59:54 +0800 |
---|---|---|
committer | chhsiao90 <chhsiao90@gmail.com> | 2016-10-25 10:46:53 +0800 |
commit | 39ac29e37c25b998f4fca48d980b5e09907f2566 (patch) | |
tree | 25f1f898151bd646c30a02b843539b62ac8b24c2 /mitmproxy/connections.py | |
parent | 21f133fae9faf16f5b4322fab3e92eaa8a2bb719 (diff) | |
download | mitmproxy-39ac29e37c25b998f4fca48d980b5e09907f2566.tar.gz mitmproxy-39ac29e37c25b998f4fca48d980b5e09907f2566.tar.bz2 mitmproxy-39ac29e37c25b998f4fca48d980b5e09907f2566.zip |
Resolved #1639: display sni on ClientConnection
Diffstat (limited to 'mitmproxy/connections.py')
-rw-r--r-- | mitmproxy/connections.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mitmproxy/connections.py b/mitmproxy/connections.py index 015d0689..1c35ec7f 100644 --- a/mitmproxy/connections.py +++ b/mitmproxy/connections.py @@ -20,6 +20,7 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): timestamp_start: Connection start timestamp timestamp_ssl_setup: TLS established timestamp timestamp_end: Connection end timestamp + sni: Server Name Indication sent by client during the TLS handshake """ def __init__(self, client_connection, address, server): @@ -40,6 +41,7 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): self.timestamp_end = None self.timestamp_ssl_setup = None self.protocol = None + self.sni = None def __bool__(self): return bool(self.connection) and not self.finished @@ -61,6 +63,7 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): timestamp_start=float, timestamp_ssl_setup=float, timestamp_end=float, + sni=str, ) def copy(self): @@ -86,12 +89,14 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): ssl_established=False, timestamp_start=None, timestamp_end=None, - timestamp_ssl_setup=None + timestamp_ssl_setup=None, + sni=None )) def convert_to_ssl(self, *args, **kwargs): super().convert_to_ssl(*args, **kwargs) self.timestamp_ssl_setup = time.time() + self.sni = self.connection.get_servername() def finish(self): super().finish() |