Skip to content

Commit

Permalink
Turn on ssl verify for requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
cro committed May 4, 2015
1 parent ea20176 commit 860d4b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion salt/cloud/clouds/aliyun.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ def query(params=None):
signature = _compute_signature(parameters, access_key_secret)
parameters['Signature'] = signature

request = requests.get(path, params=parameters, verify=False)
request = requests.get(path, params=parameters, verify=True)
if request.status_code != 200:
raise SaltCloudSystemExit(
'An error occurred while querying aliyun ECS. HTTP Code: {0} '
Expand Down
10 changes: 5 additions & 5 deletions salt/cloud/clouds/proxmox.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def _authenticate():
full_url = 'https://{0}:8006/api2/json/access/ticket'.format(url)

returned_data = requests.post(
full_url, verify=False, data=connect_data).json()
full_url, verify=True, data=connect_data).json()

ticket = {'PVEAuthCookie': returned_data['data']['ticket']}
csrf = str(returned_data['data']['CSRFPreventionToken'])
Expand All @@ -132,24 +132,24 @@ def query(conn_type, option, post_data=None):

if conn_type == 'post':
httpheaders['CSRFPreventionToken'] = csrf
response = requests.post(full_url, verify=False,
response = requests.post(full_url, verify=True,
data=post_data,
cookies=ticket,
headers=httpheaders)
elif conn_type == 'put':
httpheaders['CSRFPreventionToken'] = csrf
response = requests.put(full_url, verify=False,
response = requests.put(full_url, verify=True,
data=post_data,
cookies=ticket,
headers=httpheaders)
elif conn_type == 'delete':
httpheaders['CSRFPreventionToken'] = csrf
response = requests.delete(full_url, verify=False,
response = requests.delete(full_url, verify=True,
data=post_data,
cookies=ticket,
headers=httpheaders)
elif conn_type == 'get':
response = requests.get(full_url, verify=False,
response = requests.get(full_url, verify=True,
cookies=ticket)

response.raise_for_status()
Expand Down

0 comments on commit 860d4b7

Please sign in to comment.