aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/proxy
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2015-08-01 10:41:21 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2015-08-01 14:37:32 +0200
commit8a051511706e2e62c32e0f70e05ecab11d444b6f (patch)
tree7cfdfe194515be7d66050014dafcd04dbb52b769 /libmproxy/proxy
parentc31b6c3c36f681d1dbc3ce11922741b7e1e41837 (diff)
downloadmitmproxy-8a051511706e2e62c32e0f70e05ecab11d444b6f.tar.gz
mitmproxy-8a051511706e2e62c32e0f70e05ecab11d444b6f.tar.bz2
mitmproxy-8a051511706e2e62c32e0f70e05ecab11d444b6f.zip
revert ALPN-related changes to fix master
In the future this should be added again to support HTTP/2.
Diffstat (limited to 'libmproxy/proxy')
-rw-r--r--libmproxy/proxy/connection.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/libmproxy/proxy/connection.py b/libmproxy/proxy/connection.py
index a0bf2af9..9e03157a 100644
--- a/libmproxy/proxy/connection.py
+++ b/libmproxy/proxy/connection.py
@@ -71,15 +71,16 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject):
return f
def convert_to_ssl(self, *args, **kwargs):
- def alpn_select_callback(conn_, options):
- if alpn_select in options:
- return bytes(alpn_select)
- else: # pragma no cover
- return options[0]
-
# TODO: read ALPN from server and select same proto for client conn
-
- tcp.BaseHandler.convert_to_ssl(self, alpn_select=alpn_select_callback, *args, **kwargs)
+ # alpn_select = 'h2'
+ # def alpn_select_callback(conn_, options):
+ # if alpn_select in options:
+ # return bytes(alpn_select)
+ # else: # pragma no cover
+ # return options[0]
+ # tcp.BaseHandler.convert_to_ssl(self, alpn_select=alpn_select_callback, *args, **kwargs)
+
+ tcp.BaseHandler.convert_to_ssl(self, *args, **kwargs)
self.timestamp_ssl_setup = utils.timestamp()
def finish(self):
@@ -176,8 +177,9 @@ class ServerConnection(tcp.TCPClient, stateobject.StateObject):
clientcert = path
# TODO: read ALPN from client and use same list for server conn
+ # self.convert_to_ssl(cert=clientcert, sni=sni, alpn_protos=[netlib.http.http2.HTTP2Protocol.ALPN_PROTO_H2], **kwargs)
- self.convert_to_ssl(cert=clientcert, sni=sni, alpn_protos=['h2'], **kwargs)
+ self.convert_to_ssl(cert=clientcert, sni=sni, **kwargs)
self.sni = sni
self.timestamp_ssl_setup = utils.timestamp()