You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature: Mention how to configure path to OpenSSL #1727
Describe the enhancement or feature you would like
I would like the devguide (Setup and building / Troubleshoot the build) to mention a solution for troubleshooting issues with building the ssl module - specifically, this error:
Could not build the ssl module!
Python requires a OpenSSL 1.1.1 or newer
After a lot of trial and error I found this comment on a GH issue which solved my problem. The key is to set --with-openssl-rpath=auto when running ./configure.
If other's agree, I am happy to open a PR that adds this to the devguide 🙂
Describe alternatives you have considered
I searched the web for similar issues and found a not-so-helpful SO answer, but eventually ended up at this comment, which helped me solve my problem.
Additional context
I tried to setup my machine (Linux, Ubuntu, WSL) to compile and build CPython according to the devguide. However, I got stuck with the following error after running ./configure --with-pydebug followed by make:
Could not build the ssl module!
Python requires a OpenSSL 1.1.1 or newer
I ran openssl --version and got OpenSSL 3.4.0 22 Oct 2024. Then, I ensured that I had all dependencies installed to build all optional modules. Still, I got the same error.
After some searching, I found the configure option --with-openssl=DIR which I pointed to the directory of the openssl binary - did not help.
(I wanted to build the ssl module because otherwise I could not install packages with pip in my virtual environment created with the built Python.)
Looking at where the error is produced, if OPENSSL_LDFLAGS was set, it would have pointed to --with-openssl-rpath=auto:
ifany(
modinfo.name=="_ssl"formodinfoinself.missing+self.failed_on_import
):
print("Could not build the ssl module!")
print("Python requires a OpenSSL 1.1.1 or newer")
ifsysconfig.get_config_var("OPENSSL_LDFLAGS"):
print("Custom linker flags may require --with-openssl-rpath=auto")
Hi @RafaelWO, this is a useful addition to the devguide. I’d like to help clarify or document the steps for configuring the path to OpenSSL and handling --with-openssl-rpath=auto. Could you please assign me so I can contribute?
Activity
hugovk commentedon Jan 25, 2026
Looking at where the error is produced, if
OPENSSL_LDFLAGSwas set, it would have pointed to--with-openssl-rpath=auto:https://github.com/python/cpython/blob/979d92fefc0b6863c9783659f80d36cdfac90506/Tools/build/check_extension_modules.py#L267-L273
RafaelWO commentedon Jan 26, 2026
Not sure if I can follow... does this mean I should have set
OPENSSL_LDFLAGS? 🤔Muawiya-contact commentedon Jan 30, 2026
Hi @RafaelWO, this is a useful addition to the devguide. I’d like to help clarify or document the steps for configuring the path to OpenSSL and handling --with-openssl-rpath=auto. Could you please assign me so I can contribute?
StanFromIreland commentedon Jan 30, 2026
As I've told you already, we generally don't assign issues here.
Docs: Add troubleshooting for OpenSSL build errors
willingc commentedon Apr 20, 2026
Closing this issue based on #1731 (comment). I don't think that additional documentation is required now. Thanks for the suggestion though.
willingc commentedon Apr 20, 2026
Thanks @StanFromIreland. I always forget that option.