diff options
author | Aldo Cortesi <aldo@corte.si> | 2016-02-19 11:56:50 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@corte.si> | 2016-02-19 11:56:50 +1300 |
commit | 3d477c72d3283f26cff99139c957b317c984cc7b (patch) | |
tree | d7c427f151f24aba17cf2591b0945c108c028021 /mitmproxy/dump.py | |
parent | ecb26c3c822ff4f4c61233c8265faed666625677 (diff) | |
parent | 7d2c7efa575a7338ed5402972ae8772be4b0298d (diff) | |
download | mitmproxy-3d477c72d3283f26cff99139c957b317c984cc7b.tar.gz mitmproxy-3d477c72d3283f26cff99139c957b317c984cc7b.tar.bz2 mitmproxy-3d477c72d3283f26cff99139c957b317c984cc7b.zip |
Merge pull request #960 from Kriechi/enable-h2
enable HTTP/2 by default if available
Diffstat (limited to 'mitmproxy/dump.py')
-rw-r--r-- | mitmproxy/dump.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mitmproxy/dump.py b/mitmproxy/dump.py index 6dab2ddc..d7f076cf 100644 --- a/mitmproxy/dump.py +++ b/mitmproxy/dump.py @@ -1,9 +1,10 @@ from __future__ import absolute_import, print_function import traceback - +import sys import click import itertools +from netlib import tcp from netlib.http import CONTENT_MISSING import netlib.utils from . import flow, filt, contentviews @@ -72,6 +73,11 @@ class DumpMaster(flow.FlowMaster): self.set_stream_large_bodies(options.stream_large_bodies) + if self.server.config.http2 and not tcp.HAS_ALPN: # pragma: no cover + print("ALPN support missing (OpenSSL 1.0.2+ required)!\n" + "HTTP/2 is disabled. Use --no-http2 to silence this warning.", + file=sys.stderr) + if options.filtstr: self.filt = filt.parse(options.filtstr) else: |