From dcb7b3e28e0b8f01ebd4a91129333185d04b1821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Wed, 29 Sep 2021 13:42:26 +0200 Subject: [PATCH] Make 3.5 client compatible with python 3.6 --- client-py3/full/src/uds/rest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client-py3/full/src/uds/rest.py b/client-py3/full/src/uds/rest.py index 7a05d9db..85427cdb 100644 --- a/client-py3/full/src/uds/rest.py +++ b/client-py3/full/src/uds/rest.py @@ -185,8 +185,8 @@ class RestApi: ) -> typing.Any: print('Open') ctx = ssl.create_default_context() - ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE + ctx.check_hostname = False ctx.load_verify_locations(tools.getCaCertsFile()) hostname = urllib.parse.urlparse(url)[1] serial = '' @@ -212,8 +212,8 @@ class RestApi: serial = hex(cert.serial_number)[2:] response = None - ctx.check_hostname = True ctx.verify_mode = ssl.CERT_REQUIRED + ctx.check_hostname = True def urlopen(url: str): # Generate the request with the headers @@ -232,8 +232,8 @@ class RestApi: # Ask about invalid certificate if certErrorCallback: if certErrorCallback(hostname, serial): - ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE + ctx.check_hostname = False response = urlopen(url) else: raise