Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed use of hard-coded values for the verify parameter being supplied to requests calls #113

Merged
merged 1 commit into from Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
fixed use of hard-coded values for the verify parameter being supplie…
…d to the requests module calls
  • Loading branch information
Glenn Snyder committed Oct 22, 2020
commit 273b27d0de1004389dd8cf43c40b1197c787e7cd
6 changes: 3 additions & 3 deletions blackduck/HubRestApi.py
Expand Up @@ -1307,11 +1307,11 @@ def upload_scan(self, filename):
if filename.endswith('.json') or filename.endswith('.jsonld'):
headers['Content-Type'] = 'application/ld+json'
with open(filename,"r") as f:
response = requests.post(url, headers=headers, data=f, verify=False)
response = requests.post(url, headers=headers, data=f, verify=not self.config['insecure'])
elif filename.endswith('.bdio'):
headers['Content-Type'] = 'application/vnd.blackducksoftware.bdio+zip'
with open(filename,"rb") as f:
response = requests.post(url, headers=headers, data=f, verify=False)
response = requests.post(url, headers=headers, data=f, verify=not self.config['insecure'])
else:
raise Exception("Unkown file type")
return response
Expand All @@ -1338,7 +1338,7 @@ def download_project_scans(self, project_name,version_name, output_folder=None):
if not os.path.exists(project_name):
os.mkdir(project_name)
pathname = os.path.join(project_name, filename)
responce = requests.get(url, headers=self.get_headers(), stream=True, verify=False)
responce = requests.get(url, headers=self.get_headers(), stream=True, verify=not self.config['insecure'])
with open(pathname, "wb") as f:
for data in responce.iter_content():
f.write(data)
Expand Down
2 changes: 1 addition & 1 deletion blackduck/__version__.py
@@ -1,3 +1,3 @@
VERSION = (0, 0, 52)
VERSION = (0, 0, 53)

__version__ = '.'.join(map(str, VERSION))