Skip to content

Feature: Mention how to configure path to OpenSSL #1727

Description

@RafaelWO

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.)

Activity

  1. hugovk commented on Jan 25, 2026

    @hugovk
    Member

    Looking at where the error is produced, if OPENSSL_LDFLAGS was set, it would have pointed to --with-openssl-rpath=auto:

            if any(
                modinfo.name == "_ssl" for modinfo in self.missing + self.failed_on_import
            ):
                print("Could not build the ssl module!")
                print("Python requires a OpenSSL 1.1.1 or newer")
                if sysconfig.get_config_var("OPENSSL_LDFLAGS"):
                    print("Custom linker flags may require --with-openssl-rpath=auto")

    https://github.com/python/cpython/blob/979d92fefc0b6863c9783659f80d36cdfac90506/Tools/build/check_extension_modules.py#L267-L273

  2. RafaelWO commented on Jan 26, 2026

    @RafaelWO
    ContributorAuthor

    Not sure if I can follow... does this mean I should have set OPENSSL_LDFLAGS? 🤔

  3. Muawiya-contact commented on Jan 30, 2026

    @Muawiya-contact

    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?

  4. StanFromIreland commented on Jan 30, 2026

    @StanFromIreland
    Member

    As I've told you already, we generally don't assign issues here.

  5. added a commit that references this issue on Feb 8, 2026
    20ad71e
  6. willingc commented on Apr 20, 2026

    @willingc
    Collaborator

    Closing this issue based on #1731 (comment). I don't think that additional documentation is required now. Thanks for the suggestion though.

  7. willingc commented on Apr 20, 2026

    @willingc
    Collaborator

    Thanks @StanFromIreland. I always forget that option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions