Skip to content

gh-135261: bring back CI job for testing OpenSSL 1.1.1w #135262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 24, 2025

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Jun 8, 2025

I don't think I need to regen the OpenSSL data here so I'll just check if the CI job works.

@picnixz
Copy link
Member Author

picnixz commented Jun 8, 2025

Ok, everything looks good. I'll let a code owner merge this one (I don't need it immediately, but it can ease my life later on)

@ned-deily
Copy link
Member

FTR, this PR would effectively revert #123701 from nine months ago. Do we want to do that?

@picnixz
Copy link
Member Author

picnixz commented Jun 8, 2025

I do want it because we have code that is conditioned to OpenSSL version. And the (official) build requirements are still 1.1.1w so it makes sense to test this. Otherwise I don't know when we test those paths.

@AA-Turner
Copy link
Member

cc @zware

@ned-deily
Copy link
Member

ned-deily commented Jun 8, 2025

See my comment on the issue: in short, we should update the build requirements docs and not provide free support for something that the OpenSSL project charges lots of money for.

@gpshead, any opinions on this?

@ned-deily
Copy link
Member

If we do agree to update the build requirements doc, we should also update the OpenSSL version test in configure.ac to issue an unsupported warning if attempting to build with a 1.1.1 version.

@picnixz
Copy link
Member Author

picnixz commented Aug 23, 2025

I really want to add this job because it's tiring for me to re-configure my local Python to switch between the two implementations. Because we now support AWS-LC in the CI which has 1.1.1-like API and because we still have non-dead code with OpenSSL 1.1.1, I will merge this one next week.

If we decide to drop 1.1.1, then we should really be careful because I don't think it makes sense to say that we drop the support but we still have code expecting to work. The matter of OpenSSL is not only about the SSL module. It's also about the hashlib module which still relies on OpenSSL 1.1.1 functions for HMAC (I'm currently adding support for OpenSSL 3.x). I don't know if AWS-LC supports EVP interface for HMAC though and whether it's detected as a OpenSSL 3.x or OpenSSL 1.1.1.

In the SSL module, we are still using APIs that were deprecated in OpenSSL 1.1.0 such as TLS 1.1 & 1.2. However, there is no removal plan for supporting those protocols (there's only a deprecation warning). So removing 1.1.1 support also means removing support for deprecated protocols in one go, which can't be achieved before Python 3.17 at the earliest (but I would recommend at least a 5-years deprecation period, or maybe only a soft deprecation).

@AA-Turner
Copy link
Member

Does the rationale from the issue re upstream EOL still apply?

@picnixz
Copy link
Member Author

picnixz commented Aug 23, 2025

Does the rationale from the issue re upstream EOL still apply?

Well.. it depends. I agree that OpenSSL 1.1.1 is EOL and we shouldn't support something that is EOL. However, it's actually more than just supporting. OpenSSL 3.x has functions that are deprecated since OpenSSL 1.1.1 and but we still use the following guard:

#ifndef OPENSSL_API_COMPAT
  // 0x10101000L == 1.1.1, 30000 == 3.0.0
  #define OPENSSL_API_COMPAT 0x10101000L
#endif

IOW, we ask OpenSSL 3.x to expose those functions as being stable and not deprecated. Now, at runtime, if the user has OpenSSL 3.x, then it will directly use the OpenSSL 3.x bindings. In the current code of hashlib and ssl, we use functions that are both present in OpenSSL 1.1.1 and OpenSSL 3.x, and those functions are either stable or deprecated depending on the bindings. For the OpenSSL 3.x user, it's as if they are using OpenSSL 1.1.1. But for an OpenSSL 1.1.1 user, they are using a stable version for them.

Let's say we drop 1.1.1 support because it's EOL. This means switching all 1.1.1-like API calls to 3.x API calls. Unfortunately those are not necessarily straightforward (as shown for the HMAC PR). For SSL, it's even worse as we have many more functions that are deprecated in 3.x (like TLS 1.2). We need to switch to SSL_CTX_new_ex instead of version-specific functions if we want to use OpenSSL 3.x functions, but that's a very long work...

I don't think it makes sense to actually use deprecated functions ourselves but require people to upgrade their OpenSSL version. We would still not use the new API. And code where we have conditional checks depending on the OpenSSL version either need to be removed entirely (but I don't think we can just drop OpenSSL 1.1.1 support in Python 3.15, I'd like to give sufficient time to downstream users), or they should be tested until wew decide to remove them (that's my point: test any code that can be executed at runtime, until it's removed).

@picnixz
Copy link
Member Author

picnixz commented Aug 23, 2025

Personally, I would be very happy if I could assume that the underlying OpenSSL library is 3.x and later. Unforunately, that's not the case, so I need a way to test my code for all users that could not necessarily be using 3.x. We can always remove the job once all requirements have been bumped but I would advise against bumping requirements while retaining code that assume a lower version. I think it's preferrable that we have two implementations at one time (with ifdef guards) and once it's migrated and tested, we can bump it and remove dead code (so that we don't use deprecated features)

@picnixz picnixz enabled auto-merge (squash) August 24, 2025 08:44
@picnixz picnixz disabled auto-merge August 24, 2025 08:45
@picnixz picnixz enabled auto-merge (squash) August 24, 2025 08:51
@picnixz picnixz changed the title gh-135261: add CI job for testing OpenSSL 1.1.1w gh-135261: bring back CI job for testing OpenSSL 1.1.1w Aug 24, 2025
@picnixz picnixz merged commit 96b7a2e into python:main Aug 24, 2025
43 checks passed
@miss-islington-app
Copy link

Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 24, 2025
…GH-135262)

This partially reverts commit d83e30c
by bringing back the CI job for testing OpenSSL 1.1.1w. Despite this
version being upstream EOL, the rationale for keeping it as follows:

- It most resembles other 1.1.1-work-a-like ssl APIs supported by important vendors.
- Python officially requires OpenSSL 1.1.1 or later, although OpenSSL 3.0 or later
  is recommended for cryptographic modules. Since changing the build requirements
  requires a transition period, we need to keep testing the allowed versions.
- The code base still contains calls to OpenSSL functions that are deprecated since
  OpenSSL 3.0 as well as `ifdef` blocks constrained to OpenSSL 1.1.1.
(cherry picked from commit 96b7a2e)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@miss-islington-app
Copy link

Sorry, @picnixz, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 96b7a2eba423b42320f15fd4974740e3e930bb8b 3.13

@bedevere-app
Copy link

bedevere-app bot commented Aug 24, 2025

GH-138109 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Aug 24, 2025
picnixz added a commit to picnixz/cpython that referenced this pull request Aug 24, 2025
…ythonGH-135262)

This partially reverts commit d83e30c
by bringing back the CI job for testing OpenSSL 1.1.1w. Despite this
version being upstream EOL, the rationale for keeping it as follows:

- It most resembles other 1.1.1-work-a-like ssl APIs supported by important vendors.
- Python officially requires OpenSSL 1.1.1 or later, although OpenSSL 3.0 or later
  is recommended for cryptographic modules. Since changing the build requirements
  requires a transition period, we need to keep testing the allowed versions.
- The code base still contains calls to OpenSSL functions that are deprecated since
  OpenSSL 3.0 as well as `ifdef` blocks constrained to OpenSSL 1.1.1.
(cherry picked from commit 96b7a2e)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Aug 24, 2025

GH-138110 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Aug 24, 2025
picnixz added a commit to picnixz/cpython that referenced this pull request Aug 24, 2025
…ythonGH-135262)

This partially reverts commit ad944b5
by bringing back the CI job for testing OpenSSL 1.1.1w. Despite this
version being upstream EOL, the rationale for keeping it as follows:

- It most resembles other 1.1.1-work-a-like ssl APIs supported by important vendors.
- Python officially requires OpenSSL 1.1.1 or later, although OpenSSL 3.0 or later
  is recommended for cryptographic modules. Since changing the build requirements
  requires a transition period, we need to keep testing the allowed versions.
- The code base still contains calls to OpenSSL functions that are deprecated since
  OpenSSL 3.0 as well as `ifdef` blocks constrained to OpenSSL 1.1.1.

(cherry picked from commit 96b7a2e)
picnixz added a commit to miss-islington/cpython that referenced this pull request Aug 24, 2025
…GH-135262)

This partially reverts commit d83e30c
by bringing back the CI job for testing OpenSSL 1.1.1w. Despite this
version being upstream EOL, the rationale for keeping it as follows:

- It most resembles other 1.1.1-work-a-like ssl APIs supported by important vendors.
- Python officially requires OpenSSL 1.1.1 or later, although OpenSSL 3.0 or later
  is recommended for cryptographic modules. Since changing the build requirements
  requires a transition period, we need to keep testing the allowed versions.
- The code base still contains calls to OpenSSL functions that are deprecated since
  OpenSSL 3.0 as well as `ifdef` blocks constrained to OpenSSL 1.1.1.

(cherry picked from commit 96b7a2e)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@picnixz picnixz deleted the infra/test/openssl-135261 branch August 24, 2025 09:24
picnixz added a commit that referenced this pull request Aug 24, 2025
…5262) (#138110)

This partially reverts commit ad944b5
by bringing back the CI job for testing OpenSSL 1.1.1w. Despite this
version being upstream EOL, the rationale for keeping it as follows:

- It most resembles other 1.1.1-work-a-like ssl APIs supported by important vendors.
- Python officially requires OpenSSL 1.1.1 or later, although OpenSSL 3.0 or later
  is recommended for cryptographic modules. Since changing the build requirements
  requires a transition period, we need to keep testing the allowed versions.
- The code base still contains calls to OpenSSL functions that are deprecated since
  OpenSSL 3.0 as well as `ifdef` blocks constrained to OpenSSL 1.1.1.

(cherry picked from commit 96b7a2e)
krisztian-gajdar added a commit to krisztian-gajdar/cpython that referenced this pull request Aug 24, 2025
…tuations

docs: add news entry for TracebackException punctuation fix

style: remove trailing whitespace in traceback.py

Update 2025-08-24-11-42-38.gh-issue-137716.7-Mtj-.rst

Update 2025-08-24-11-42-38.gh-issue-137716.7-Mtj-.rst

refactor: improve suggestion message computation and punctuation handling

style: remove trailing whitespace in traceback.py

pythongh-137986: Fix and improve the csv functions docstrings (pythonGH-137987)

The csv.register_dialect() docstring no longer imply that it returns a
dialect.
All functions have now signatures.

Co-authored-by: maurycy <5383+maurycy@users.noreply.github.com>

pythongh-135261: bring back CI job for testing OpenSSL 1.1.1w (python#135262)

This partially reverts commit d83e30c
by bringing back the CI job for testing OpenSSL 1.1.1w. Despite this
version being upstream EOL, the rationale for keeping it as follows:

- It most resembles other 1.1.1-work-a-like ssl APIs supported by important vendors.
- Python officially requires OpenSSL 1.1.1 or later, although OpenSSL 3.0 or later
  is recommended for cryptographic modules. Since changing the build requirements
  requires a transition period, we need to keep testing the allowed versions.
- The code base still contains calls to OpenSSL functions that are deprecated since
  OpenSSL 3.0 as well as `ifdef` blocks constrained to OpenSSL 1.1.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants