aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/pathoc.py
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2015-06-08 15:28:19 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2015-06-15 15:50:44 +0200
commit9ececa637d69ee3991fbc82f3cd64ae781a86f5d (patch)
tree88a8590ad9f7bfe4cb3d9143613cf1bf3abecbc0 /libpathod/pathoc.py
parent6be65954259c845f594ea4f4515b928d0c1ee24c (diff)
downloadmitmproxy-9ececa637d69ee3991fbc82f3cd64ae781a86f5d.tar.gz
mitmproxy-9ececa637d69ee3991fbc82f3cd64ae781a86f5d.tar.bz2
mitmproxy-9ececa637d69ee3991fbc82f3cd64ae781a86f5d.zip
http2: add warning for missing ALPN support
Diffstat (limited to 'libpathod/pathoc.py')
-rw-r--r--libpathod/pathoc.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py
index ba06b2f1..e9bd5f56 100644
--- a/libpathod/pathoc.py
+++ b/libpathod/pathoc.py
@@ -216,6 +216,10 @@ class Pathoc(tcp.TCPClient):
self.ws_framereader = None
if self.use_http2:
+ if not OpenSSL._util.lib.Cryptography_HAS_ALPN: # pragma: nocover
+ print >> sys.stderr, "HTTP/2 requires ALPN support. Please use OpenSSL >= 1.0.2."
+ print >> sys.stderr, "Pathoc might not be working as expected without ALPN."
+
self.protocol = http2.HTTP2Protocol(self)
else:
# TODO: create HTTP or Websockets protocol
@@ -259,7 +263,7 @@ class Pathoc(tcp.TCPClient):
an HTTP CONNECT request.
"""
if self.use_http2 and not self.ssl:
- raise ValueError("HTTP2 without SSL is not supported.")
+ raise NotImplementedError("HTTP2 without SSL is not supported.")
tcp.TCPClient.connect(self)