diff options
author | Aldo Cortesi <aldo@corte.si> | 2017-04-27 07:40:14 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-27 07:40:14 +1200 |
commit | 2a46f3851a468263b53298b643f92a36b713128e (patch) | |
tree | b4b9495d84a16245182ed93f427dbaa276f3c7c5 /examples/complex/tls_passthrough.py | |
parent | ab07b79138a79fd7b09a3d4d0b8da8ab07c342d8 (diff) | |
parent | 5327756377d239f059e84de4063cfcaa592fdb3d (diff) | |
download | mitmproxy-2a46f3851a468263b53298b643f92a36b713128e.tar.gz mitmproxy-2a46f3851a468263b53298b643f92a36b713128e.tar.bz2 mitmproxy-2a46f3851a468263b53298b643f92a36b713128e.zip |
Merge pull request #2265 from cortesi/addons
Addons and addon testing
Diffstat (limited to 'examples/complex/tls_passthrough.py')
-rw-r--r-- | examples/complex/tls_passthrough.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/examples/complex/tls_passthrough.py b/examples/complex/tls_passthrough.py index 72c0244b..9bb27d25 100644 --- a/examples/complex/tls_passthrough.py +++ b/examples/complex/tls_passthrough.py @@ -23,10 +23,10 @@ Authors: Maximilian Hils, Matthew Tuusberg import collections import random -import sys from enum import Enum import mitmproxy +from mitmproxy import ctx from mitmproxy.exceptions import TlsProtocolException from mitmproxy.proxy.protocol import TlsLayer, RawTCPLayer @@ -113,9 +113,15 @@ tls_strategy = None def load(l): + l.add_option( + "tlsstrat", int, 0, "TLS passthrough strategy (0-100)", + ) + + +def configure(updated): global tls_strategy - if len(sys.argv) == 2: - tls_strategy = ProbabilisticStrategy(float(sys.argv[1])) + if ctx.options.tlsstrat > 0: + tls_strategy = ProbabilisticStrategy(float(ctx.options.tlsstrat) / 100.0) else: tls_strategy = ConservativeStrategy() |