diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2014-01-12 12:49:19 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2014-01-12 12:49:19 +1300 |
commit | 58e1b3a47f392a5f4f16e30318820f163568f54e (patch) | |
tree | e6cd91e3575eb8d9dff5e7201177357d3c32fed4 /libmproxy/proxy.py | |
parent | 2f63da99c938646568e5731d748b1c5507a0da29 (diff) | |
download | mitmproxy-58e1b3a47f392a5f4f16e30318820f163568f54e.tar.gz mitmproxy-58e1b3a47f392a5f4f16e30318820f163568f54e.tar.bz2 mitmproxy-58e1b3a47f392a5f4f16e30318820f163568f54e.zip |
Start refactoring scripts
- Move ScriptContext into script module
- Use mock module instead of hand-rolled mock objects in tests
Diffstat (limited to 'libmproxy/proxy.py')
-rw-r--r-- | libmproxy/proxy.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py index 15f75b8d..1894f7f0 100644 --- a/libmproxy/proxy.py +++ b/libmproxy/proxy.py @@ -110,15 +110,15 @@ class HandleSNI: self.handler, self.client_conn, self.host, self.port = handler, client_conn, host, port self.cert, self.key = cert, key - def __call__(self, connection): + def __call__(self, client_connection): try: - sn = connection.get_servername() + sn = client_connection.get_servername() if sn: self.handler.get_server_connection(self.client_conn, "https", self.host, self.port, sn) new_context = SSL.Context(SSL.TLSv1_METHOD) new_context.use_privatekey_file(self.key) new_context.use_certificate(self.cert.x509) - connection.set_context(new_context) + client_connection.set_context(new_context) self.handler.sni = sn.decode("utf8").encode("idna") # An unhandled exception in this method will core dump PyOpenSSL, so # make dang sure it doesn't happen. |