diff --git a/SAS/TMSS/client/lib/tmss_http_rest_client.py b/SAS/TMSS/client/lib/tmss_http_rest_client.py index ef61474f0a8fe134eaaec512166274a02c1cec9b..8b0226778d656abcf43c0ca0f0632248161d01a9 100644 --- a/SAS/TMSS/client/lib/tmss_http_rest_client.py +++ b/SAS/TMSS/client/lib/tmss_http_rest_client.py @@ -5,10 +5,18 @@ import typing logger = logging.getLogger(__name__) # see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings +# and https://stackoverflow.com/questions/27981545/suppress-insecurerequestwarning-unverified-https-request-is-being-made-in-pytho import urllib3 -urllib3.disable_warnings() - import requests +if requests.__version__ >= '2.16.0': + urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) +else: + try: + from requests.packages.urllib3.exceptions import InsecureRequestWarning + requests.packages.urllib3.disable_warnings(InsecureRequestWarning) + except ImportError: + pass + from http.client import responses import os try: