diff options
author | chhsiao90 <chhsiao90@gmail.com> | 2016-10-26 14:36:14 +0800 |
---|---|---|
committer | chhsiao90 <chhsiao90@gmail.com> | 2016-10-26 14:36:14 +0800 |
commit | d52f35428c835d30b2f2be72d9258a8d908e5072 (patch) | |
tree | dffba181c36ef4eba9a8de4a20a9c5b636b963bb /mitmproxy/connections.py | |
parent | 960f2e8bf0432ade836f73864e4ed33295194420 (diff) | |
download | mitmproxy-d52f35428c835d30b2f2be72d9258a8d908e5072.tar.gz mitmproxy-d52f35428c835d30b2f2be72d9258a8d908e5072.tar.bz2 mitmproxy-d52f35428c835d30b2f2be72d9258a8d908e5072.zip |
Show tls version on console
Diffstat (limited to 'mitmproxy/connections.py')
-rw-r--r-- | mitmproxy/connections.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mitmproxy/connections.py b/mitmproxy/connections.py index 89c6b501..b565be78 100644 --- a/mitmproxy/connections.py +++ b/mitmproxy/connections.py @@ -22,6 +22,7 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): timestamp_end: Connection end timestamp sni: Server Name Indication sent by client during the TLS handshake cipher_name: The current used cipher + tls_version: TLS version """ def __init__(self, client_connection, address, server): @@ -44,6 +45,7 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): self.protocol = None self.sni = None self.cipher_name = None + self.tls_version = None def __bool__(self): return bool(self.connection) and not self.finished @@ -67,6 +69,7 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): timestamp_end=float, sni=str, cipher_name=str, + tls_version=str, ) def copy(self): @@ -95,6 +98,7 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): timestamp_ssl_setup=None, sni=None, cipher_name=None, + tls_version=None, )) def convert_to_ssl(self, *args, **kwargs): @@ -102,6 +106,7 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): self.timestamp_ssl_setup = time.time() self.sni = self.connection.get_servername() self.cipher_name = self.connection.get_cipher_name() + self.tls_version = self.connection.get_protocol_version_name() def finish(self): super().finish() |