Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions relenv/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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..
Expand Down Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions tests/test_verify_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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() == ""
Loading