diff --git a/demos/tests/run_tests.py b/demos/tests/run_tests.py index 8fa4f56bc7c..ce071adfdd5 100755 --- a/demos/tests/run_tests.py +++ b/demos/tests/run_tests.py @@ -29,12 +29,12 @@ """ import argparse +import certifi import contextlib import csv import json import os import shlex -import ssl import subprocess # nosec B404 # disable import-subprocess check import sys import tempfile @@ -241,11 +241,9 @@ 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 B310 # disable urllib_urlopen because url is hardcoded + os.environ["REQUESTS_CA_BUNDLE"] = certifi.where() + os.environ["SSL_CERT_FILE"] = certifi.where() + with urlopen(COCO128_URL) as zipresp: # nosec B310 # disable urllib_urlopen because url is hardcoded with ZipFile(BytesIO(zipresp.read())) as zfile: zfile.extractall(args.test_data_dir)