aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-09-11 09:06:46 +1200
committerAldo Cortesi <aldo@nullcube.com>2011-09-11 09:06:46 +1200
commitee71bcfbe8a5be7f0b0bbe747ea65a3f7ca137be (patch)
tree32b571f2726de4bb76be535e20fdce9c740c04f0
parentd9db1cf5b3f7bb86a5aa0f68dcc9867c708f2158 (diff)
downloadmitmproxy-ee71bcfbe8a5be7f0b0bbe747ea65a3f7ca137be.tar.gz
mitmproxy-ee71bcfbe8a5be7f0b0bbe747ea65a3f7ca137be.tar.bz2
mitmproxy-ee71bcfbe8a5be7f0b0bbe747ea65a3f7ca137be.zip
Fix a rare crash when a new cert is generated during cerdir removal.
-rw-r--r--libmproxy/proxy.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index d1596b0a..7b6e695f 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -445,8 +445,11 @@ class ProxyServer(ServerBase):
self.RequestHandlerClass(self.config, request, client_address, self, self.masterq)
def shutdown(self):
- shutil.rmtree(self.certdir)
ServerBase.shutdown(self)
+ try:
+ shutil.rmtree(self.certdir)
+ except OSError:
+ pass
# Command-line utils