From 2616c631c1de9a08b4ea51f03030a086c646343a Mon Sep 17 00:00:00 2001 From: Wovchena Date: Mon, 14 Aug 2023 18:07:45 +0400 Subject: [PATCH 1/3] demos/tests/run_tests.py: enable sertificate verification --- demos/tests/run_tests.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/demos/tests/run_tests.py b/demos/tests/run_tests.py index 57982189aaa..98044cafb60 100755 --- a/demos/tests/run_tests.py +++ b/demos/tests/run_tests.py @@ -240,10 +240,7 @@ def main(): print(f"{len(demos_to_test)} demos will be tested:") print(*[demo.subdirectory for demo in demos_to_test], sep =',') - no_verify_because_of_windows = ssl.create_default_context() - no_verify_because_of_windows.check_hostname = False - no_verify_because_of_windows.verify_mode = ssl.CERT_NONE - with urlopen(COCO128_URL, context=no_verify_because_of_windows) as zipresp: # nosec - disable B310: urllib_urlopen because url is hardcoded + with urlopen(COCO128_URL) as zipresp: # nosec - disable B310: urllib_urlopen because url is hardcoded with ZipFile(BytesIO(zipresp.read())) as zfile: zfile.extractall(args.test_data_dir) From 622d4696c4d69dcb50ef92bc8fffa2e730bec67b Mon Sep 17 00:00:00 2001 From: Wovchena Date: Fri, 1 Sep 2023 16:33:06 +0400 Subject: [PATCH 2/3] demos/tests/run_tests.py: remove import ssl --- demos/tests/run_tests.py | 1 - 1 file changed, 1 deletion(-) diff --git a/demos/tests/run_tests.py b/demos/tests/run_tests.py index 162fc8f7e80..971fa0c7e1f 100755 --- a/demos/tests/run_tests.py +++ b/demos/tests/run_tests.py @@ -34,7 +34,6 @@ import json import os import shlex -import ssl import subprocess # nosec - disable B404:import-subprocess check import sys import tempfile From a7c81b910ea0d38461e8cca79cb4e090ab21da77 Mon Sep 17 00:00:00 2001 From: Maria Pushkina Date: Wed, 11 Oct 2023 14:06:51 +0100 Subject: [PATCH 3/3] Update run_tests.py --- demos/tests/run_tests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demos/tests/run_tests.py b/demos/tests/run_tests.py index 971fa0c7e1f..4ab65085a58 100755 --- a/demos/tests/run_tests.py +++ b/demos/tests/run_tests.py @@ -29,6 +29,7 @@ """ import argparse +import certifi import contextlib import csv import json @@ -240,7 +241,8 @@ def main(): print(f"{len(demos_to_test)} demos will be tested:") print(*[demo.subdirectory for demo in demos_to_test], sep =',') - + os.environ["REQUESTS_CA_BUNDLE"] = certifi.where() + os.environ["SSL_CERT_FILE"] = certifi.where() with urlopen(COCO128_URL) as zipresp: # nosec - disable B310: urllib_urlopen because url is hardcoded with ZipFile(BytesIO(zipresp.read())) as zfile: zfile.extractall(args.test_data_dir)