diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2018-01-05 22:46:23 +0100 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2018-01-06 10:43:47 +0100 |
commit | 9aae3213b9ebaa1ba1d23790fe4ccc5e03140cf4 (patch) | |
tree | 379958ce0ade47f6c706c1b9d83dd179d2bb08c9 /mitmproxy/io | |
parent | 1c769b0991d92abd56a098eb869d414f5fa6b5d9 (diff) | |
download | mitmproxy-9aae3213b9ebaa1ba1d23790fe4ccc5e03140cf4.tar.gz mitmproxy-9aae3213b9ebaa1ba1d23790fe4ccc5e03140cf4.tar.bz2 mitmproxy-9aae3213b9ebaa1ba1d23790fe4ccc5e03140cf4.zip |
rename TLS/SSL-related attributes
SSL is an outdated protocol superseeded by TLS. Although the commonly
used library is called OpenSSL, it is no reason to still use outdated
language for attributes.
Diffstat (limited to 'mitmproxy/io')
-rw-r--r-- | mitmproxy/io/compat.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mitmproxy/io/compat.py b/mitmproxy/io/compat.py index da9d2a44..221288c6 100644 --- a/mitmproxy/io/compat.py +++ b/mitmproxy/io/compat.py @@ -1,5 +1,9 @@ """ This module handles the import of mitmproxy flows generated by old versions. + +The flow file version is decoupled from the mitmproxy release cycle (since +v3.0.0dev) and versioning. Every change or migration gets a new flow file +version number, this prevents issues with developer builds and snapshots. """ import uuid from typing import Any, Dict, Mapping, Union # noqa @@ -119,6 +123,7 @@ def convert_200_300(data): def convert_300_4(data): data["version"] = 4 + # Ths is an empty migration to transition to the new versioning scheme. return data @@ -149,6 +154,25 @@ def convert_4_5(data): return data +def convert_5_6(data): + data["version"] = 6 + data["client_conn"]["tls_established"] = data["client_conn"].pop("ssl_established") + data["client_conn"]["timestamp_tls_setup"] = data["client_conn"].pop("timestamp_ssl_setup") + data["server_conn"]["tls_established"] = data["server_conn"].pop("ssl_established") + data["server_conn"]["timestamp_tls_setup"] = data["server_conn"].pop("timestamp_ssl_setup") + if data["server_conn"]["via"]: + data["server_conn"]["via"]["tls_established"] = data["server_conn"]["via"].pop("ssl_established", None) + data["server_conn"]["via"]["timestamp_tls_setup"] = data["server_conn"]["via"].pop("timestamp_ssl_setup", None) + return data + + +# def convert_6_7(data): +# data["version"] = 7 +# # Your changes here! +# # Make sure to also increment FLOW_FORMAT_VERSION. +# return data + + def _convert_dict_keys(o: Any) -> Any: if isinstance(o, dict): return {strutils.always_str(k): _convert_dict_keys(v) for k, v in o.items()} @@ -201,6 +225,8 @@ converters = { (2, 0): convert_200_300, (3, 0): convert_300_4, 4: convert_4_5, + 5: convert_5_6, + # 6: convert_6_7, } |