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.
This commit is contained in:
parent
7ea342d8ec
commit
d86b2ec225
1 changed files with 7 additions and 0 deletions
|
@ -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…
Reference in a new issue