Я ставил openssl из исходников.
sudo make выдаёт такое (уже пытаюсь на последних версиях):
running build_ext
building '_ssl' extension
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I/usr/local/include -I./Include -I. -I/usr/include/i386-linux-gnu -I/usr/local/include -I/usr/src/Python-3.9.6/Include -I/usr/src/Python-3.9.6 -c /usr/src/Python-3.9.6/Modules/_ssl.c -o build/temp.linux-i686-3.9/usr/src/Python-3.9.6/Modules/_ssl.o
gcc -pthread -shared build/temp.linux-i686-3.9/usr/src/Python-3.9.6/Modules/_ssl.o -L/usr/local/lib -L/usr/lib/i386-linux-gnu -L/usr/local/lib -lssl -lcrypto -o build/lib.linux-i686-3.9/_ssl.cpython-39-i386-linux-gnu.so
building '_hashlib' extension
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I/usr/local/include -I./Include -I. -I/usr/include/i386-linux-gnu -I/usr/local/include -I/usr/src/Python-3.9.6/Include -I/usr/src/Python-3.9.6 -c /usr/src/Python-3.9.6/Modules/_hashopenssl.c -o build/temp.linux-i686-3.9/usr/src/Python-3.9.6/Modules/_hashopenssl.o
gcc -pthread -shared build/temp.linux-i686-3.9/usr/src/Python-3.9.6/Modules/_hashopenssl.o -L/usr/local/lib -L/usr/lib/i386-linux-gnu -L/usr/local/lib -lssl -lcrypto -o build/lib.linux-i686-3.9/_hashlib.cpython-39-i386-linux-gnu.so
*** WARNING: renaming "_ssl" since importing it failed: libssl.so.1.1: cannot open shared object file: No such file or directory
*** WARNING: renaming "_hashlib" since importing it failed: libcrypto.so.1.1: cannot open shared object file: No such file or directory
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_lzma _uuid
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc atexit pwd
time
Following modules built successfully but were removed because they could not be imported:
_hashlib _ssl
Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381