aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/proxy.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-02-20 12:12:55 +1300
committerAldo Cortesi <aldo@nullcube.com>2011-02-20 12:17:10 +1300
commit4fc807cedd9a481db9e0fc1633d8c169f53f4a8e (patch)
treefdb9ebc487e50d7546e8eb8b50e29223458b9ec4 /libmproxy/proxy.py
parentd7ace1ce9ef3832fc766c25067f8cd23fea62d8a (diff)
downloadmitmproxy-4fc807cedd9a481db9e0fc1633d8c169f53f4a8e.tar.gz
mitmproxy-4fc807cedd9a481db9e0fc1633d8c169f53f4a8e.tar.bz2
mitmproxy-4fc807cedd9a481db9e0fc1633d8c169f53f4a8e.zip
Clean up certificate generation.
- Use templates for config files. We can re-introduce customization of the certificate attributes when we need them. - Split CA and cert generation into separate functions. - Generation methods provide an error return when generation fails. - When the user explicitly specifies a certificate, we don't generate it, but fail if it doesn't exist.
Diffstat (limited to 'libmproxy/proxy.py')
-rw-r--r--libmproxy/proxy.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index 4ab19694..e3c692b9 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -550,7 +550,7 @@ class ProxyHandler(SocketServer.StreamRequestHandler):
if config.certpath is not None:
cert = config.certpath + "/" + host + ".pem"
if not os.path.exists(cert) and config.cacert is not None:
- utils.make_bogus_cert(cert, ca=config.cacert, commonName=host)
+ utils.dummy_cert(config.certpath, config.cacert, host)
if os.path.exists(cert):
return cert
print >> sys.stderr, "WARNING: Certificate missing for %s:%d! (%s)\n" % (host, port, cert)
@@ -679,9 +679,9 @@ class ProxyServer(ServerBase):
def set_mqueue(self, q):
self.masterq = q
- def process_request(self, request, client_address):
- return ServerBase.process_request(self, request, client_address)
-
def finish_request(self, request, client_address):
self.RequestHandlerClass(request, client_address, self, self.masterq)
+ def shutdown(self):
+ ServerBase.shutdown(self)
+