Skip to content

Commit

Permalink
Disable SSL cert verification #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Dymerz committed May 9, 2020
1 parent 35f2081 commit 1827bee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sma.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def auth(self):
headers = self.__get_header(params)

try:
r = requests.post(self.__url + '/dyn/login.json', headers=headers, json=params)
r = requests.post(self.__url + '/dyn/login.json', headers=headers, json=params, verify=False)
except Exception:
return None

Expand All @@ -156,7 +156,7 @@ def logout(self):
headers = self.__get_header(params)

try:
r = requests.post(self.__url + '/dyn/logout.json?sid=' + self.ssid, headers=headers, json=params)
r = requests.post(self.__url + '/dyn/logout.json?sid=' + self.ssid, headers=headers, json=params, verify=False)
except Exception:
return False

Expand All @@ -182,7 +182,7 @@ def check_connection(self):
headers = self.__get_header(params)

try:
r = requests.post(self.__url + '/dyn/sessionCheck.json?sid=' + self.ssid, headers=headers, json=params)
r = requests.post(self.__url + '/dyn/sessionCheck.json?sid=' + self.ssid, headers=headers, json=params, verify=False)
except Exception:
return None

Expand Down Expand Up @@ -210,7 +210,7 @@ def get_value(self, key:KEY):
headers = self.__get_header(params)

try:
r = requests.post(self.__url + '/dyn/getValues.json?sid=' + self.ssid, headers=headers, json=params)
r = requests.post(self.__url + '/dyn/getValues.json?sid=' + self.ssid, headers=headers, json=params, verify=False)
except Exception:
return None

Expand All @@ -236,7 +236,7 @@ def get_all_keys(self):
headers = self.__get_header(params)

try:
r = requests.post(self.__url + '/dyn/getAllParamValues.json?sid=' + self.ssid, headers=headers, json=params)
r = requests.post(self.__url + '/dyn/getAllParamValues.json?sid=' + self.ssid, headers=headers, json=params, verify=False)
json_data = json.loads(r.text)
self.__serial = self.__serial = list(json_data['result'].keys())[0]
return json_data['result'][self.__serial]
Expand Down Expand Up @@ -267,7 +267,7 @@ def get_logger(self, start: int, end: int):
headers = self.__get_header(params)

try:
r = requests.post(self.__url + '/dyn/getLogger.json?sid=' + self.ssid, headers=headers, json=params)
r = requests.post(self.__url + '/dyn/getLogger.json?sid=' + self.ssid, headers=headers, json=params, verify=False)
except Exception:
return None

Expand Down

0 comments on commit 1827bee

Please sign in to comment.