opencv-python icon indicating copy to clipboard operation
opencv-python copied to clipboard

manylinux: avoid bundling OpenSSL to fix FIPS import crash, Related issue: #28456

Open AdityaMishra3000 opened this issue 10 months ago • 5 comments

Problem

On FIPS-enabled systems, importing cv2 aborts the Python process with:-

OpenSSL FIPS SELFTEST FAILURE
Aborted (core dumped)

I reproduced this for both opencv-python and opencv-python-headless.

How I reproduced it

I reproduced this on Rocky Linux with FIPS mode enabled (/proc/sys/crypto/fips_enabled = 1) using the published Linux wheels:

python -c "import cv2"

The process aborts immediately during module import.

Inspecting the wheel shows that cv2.abi3.so is linked against a bundled OpenSSL (opencv_python.libs/libssl*.so), which is loaded at import time and fails OpenSSL self-tests in FIPS mode.

Root cause

The manylinux build currently builds and bundles its own OpenSSL and links FFmpeg against it. On FIPS-enabled systems, this non-FIPS OpenSSL triggers a self-test failure during dlopen, aborting the process before any OpenCV code runs.

Solution

This change removes the vendored OpenSSL from the manylinux build and relies on the system OpenSSL instead. FFmpeg is still built with OpenSSL support, but discovery is done via system pkg-config paths.

System OpenSSL is FIPS-compliant on FIPS-enabled systems, which prevents the abort while preserving existing functionality.

AdityaMishra3000 avatar Jan 24 '26 18:01 AdityaMishra3000

Related issue: https://github.com/opencv/opencv-python/issues/1191

AdityaMishra3000 avatar Jan 24 '26 18:01 AdityaMishra3000

Requesting review from maintainers when convenient.

AdityaMishra3000 avatar Feb 08 '26 15:02 AdityaMishra3000

Hey @andznui, thanks for reviewing the PR, i would appreciate a approving review inorder to merge this, also let me know if i need to make any changes here.

Thank you

AdityaMishra3000 avatar Mar 01 '26 10:03 AdityaMishra3000

Hello @AdityaMishra3000 and @andznui, is this branch still under review?

c-schoenherr avatar Apr 20 '26 14:04 c-schoenherr

Will this work when OpenCV is run in a container running other distribution from the host?

kohtala avatar May 10 '26 16:05 kohtala