diff --git a/relenv/runtime.py b/relenv/runtime.py index 0740be8f..9b89e2c1 100644 --- a/relenv/runtime.py +++ b/relenv/runtime.py @@ -894,6 +894,9 @@ def setup_openssl(): """ Configure openssl certificate locations. """ + if sys.platform == "win32": + return + openssl_bin = shutil.which("openssl") if not openssl_bin: debug("Could not find the 'openssl' binary in the path") @@ -906,7 +909,7 @@ def setup_openssl(): return - if "OPENSSL_MODULES" not in os.environ and sys.platform != "win32": + if "OPENSSL_MODULES" not in os.environ: # First try and load the system's fips provider. Then load relenv's # legacy and default providers. The fips provider must be loaded first # in order OpenSSl to work properly.. @@ -946,7 +949,7 @@ def setup_openssl(): # Use system openssl dirs # XXX Should we also setup SSL_CERT_FILE, OPENSSL_CONF & # OPENSSL_CONF_INCLUDE? - if "SSL_CERT_DIR" not in os.environ and sys.platform != "win32": + if "SSL_CERT_DIR" not in os.environ: proc = subprocess.run( [openssl_bin, "version", "-d"], universal_newlines=True, diff --git a/tests/test_verify_build.py b/tests/test_verify_build.py index a3416325..a6293715 100644 --- a/tests/test_verify_build.py +++ b/tests/test_verify_build.py @@ -1718,3 +1718,12 @@ def test_no_openssl_binary(rockycontainer, pipexec): def test_darwin_python_linking(pipexec, pyexec, build, minor_version): proc = subprocess.run(["otool", "-L", str(pyexec)], capture_output=True, check=True) assert "/usr/local/opt" not in proc.stdout.decode() + + +def test_import_ssl_module(pyexec): + proc = subprocess.run( + [pyexec, "-c", "import ssl"], capture_output=True, check=False + ) + assert proc.returncode == 0 + assert proc.stdout.decode() == "" + assert proc.stderr.decode() == ""