diff --git a/utils/generate-cyclonedx b/utils/generate-cyclonedx index 611a20127d..7cfeefbc5b 100755 --- a/utils/generate-cyclonedx +++ b/utils/generate-cyclonedx @@ -9,6 +9,7 @@ import argparse +import importlib.util import json import os from pathlib import Path @@ -44,6 +45,11 @@ VULN_WITH_PEDIGREE = set() SPDX_LICENSES = [] if not SPDX_SCHEMA_PATH.exists(): + if not importlib.util.find_spec("_ssl"): + print(f"ssl module required for downloading {SPDX_SCHEMA_URL}. Try enabling BR2_PACKAGE_HOST_PYTHON3_SSL.", + file=sys.stderr) + exit(1) + # Download the CycloneDX SPDX schema JSON, and cache it locally cyclonedxpath.mkdir(parents=True, exist_ok=True) urllib.request.urlretrieve(SPDX_SCHEMA_URL, SPDX_SCHEMA_PATH)