diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-08-15 17:43:46 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-08-16 11:36:31 +0200 |
commit | 1e40d34e942382bbb11234e0e9232794b3bf6acf (patch) | |
tree | 71e7c5879dcf9d30073e23014fea627eeba2647d /libmproxy/proxy/connection.py | |
parent | 2a15479cdbda07a4a99f56f6090e479decbeb17c (diff) | |
download | mitmproxy-1e40d34e942382bbb11234e0e9232794b3bf6acf.tar.gz mitmproxy-1e40d34e942382bbb11234e0e9232794b3bf6acf.tar.bz2 mitmproxy-1e40d34e942382bbb11234e0e9232794b3bf6acf.zip |
add ALPN to proxy connections
Diffstat (limited to 'libmproxy/proxy/connection.py')
-rw-r--r-- | libmproxy/proxy/connection.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/libmproxy/proxy/connection.py b/libmproxy/proxy/connection.py index 49210e47..f33e84cd 100644 --- a/libmproxy/proxy/connection.py +++ b/libmproxy/proxy/connection.py @@ -1,6 +1,8 @@ from __future__ import absolute_import + import copy import os + from netlib import tcp, certutils from .. import stateobject, utils @@ -75,15 +77,6 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): return f def convert_to_ssl(self, *args, **kwargs): - # TODO: read ALPN from server and select same proto for client conn - # 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() @@ -184,9 +177,6 @@ class ServerConnection(tcp.TCPClient, stateobject.StateObject): if os.path.exists(path): 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, **kwargs) self.sni = sni self.timestamp_ssl_setup = utils.timestamp() |