Skip to content

Commit

Permalink
To disable SSL verification in http_client.py one need to pass it to …
Browse files Browse the repository at this point in the history
…the session.get(url, verify=False).

The current code just sets the _session object which is not taken into account.
Verified this fix by making the change in the live cluster.
  • Loading branch information
ganeshk authored and romainr committed Jun 4, 2021
1 parent 87d4004 commit fad2ae1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions desktop/core/src/desktop/lib/rest/http_client.py
Expand Up @@ -222,6 +222,8 @@ def execute(self, http_method, path, params=None, data=None, headers=None, allow
if clear_cookies:
self._session.cookies.clear()

request_kwargs['verify'] = self._session.verify

try:
resp = getattr(self._session, http_method.lower())(url, **request_kwargs)
if resp.status_code >= 300:
Expand Down
5 changes: 3 additions & 2 deletions desktop/core/src/desktop/lib/rest/http_client_test.py
Expand Up @@ -41,10 +41,11 @@ def test_http_error_rest_exception():

class MockedSession(object):

def __init__(self, cookies=None):
def __init__(self, cookies=None, verify=True):
self.cookies = cookies or {}
self.verify = verify

def put(self, relpath=None, params=None, data=None, contenttype=None, allow_redirects=False, clear_cookies=False, timeout=REST_CONN_TIMEOUT.get()):
def put(self, relpath=None, params=None, data=None, verify=True, contenttype=None, allow_redirects=False, clear_cookies=False, timeout=REST_CONN_TIMEOUT.get()):
return MockedResponse()


Expand Down

0 comments on commit fad2ae1

Please sign in to comment.