Fix issue with proxy setting leaving temp files (#17073)

When using the no_proxy option, the temp ca files that are created for
setting up an ssl context were not being deleted. 

This small patch fixes that issue by removing the temp file.
pull/17680/head
Jay 8 years ago committed by Adrian Likins
parent 7ea342d8ec
commit d86b2ec225

@ -631,6 +631,13 @@ class SSLValidationHandler(urllib2.BaseHandler):
use_proxy = self.detect_no_proxy(req.get_full_url())
if not use_proxy:
try:
# cleanup the temp file created, don't worry
# if it fails for some reason
os.remove(tmp_ca_cert_path)
except:
pass
# ignore proxy settings for this host request
return req

Loading…
Cancel
Save