Skip to content
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

gh-89532: Remove LibreSSL workarounds #28728

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

ramikg
Copy link

@ramikg ramikg commented Oct 5, 2021

Python 3.10 drops support for LibreSSL (as per PEP 644), but there are still a few workarounds & mentions of LibreSSL in the source code.

The related PR cleans the code of any LibreSSL workarounds or mentions.

https://bugs.python.org/issue45369

@ramikg ramikg changed the title bpo-45369: Remove libressl support bpo-45369: Remove LibreSSL support Oct 5, 2021
@tiran tiran changed the title bpo-45369: Remove LibreSSL support bpo-45369: Remove LibreSSL workarounds Oct 5, 2021
Copy link
Member

@tiran tiran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR.

Python 3.10 didn't actively drop support for LibreSSL. For a lack of better wording, we passively removed compatibility with forks that don't provide OpenSSL 1.1.1 API. I still like to keep some code so we can re-add LibreSSL support later.

Lib/test/test_ssl.py Outdated Show resolved Hide resolved
Tools/ssl/multissltests.py Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@tiran tiran added the needs backport to 3.10 only security fixes label Oct 5, 2021
Co-authored-by: Christian Heimes <christian@python.org>
Copy link
Member

@tiran tiran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix!

@ramikg
Copy link
Author

ramikg commented Oct 7, 2021

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@tiran: please review the changes made to this pull request.

@github-actions
Copy link

github-actions bot commented Nov 7, 2021

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Nov 7, 2021
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.11 bug and security fixes label May 20, 2022
@dhewg
Copy link

dhewg commented Jul 19, 2022

For a lack of better wording, we passively removed compatibility with forks that don't provide OpenSSL 1.1.1 API. I still like to keep some code so we can re-add LibreSSL support later.

Some time has passed, and I guess this patch sort of reflects the state of Python v3.10 with LibreSSL v3.5.
It looks like the next version will support SSL_CTX_get_security_level too.
What's left then are those four hash functions, which probably won't be added anytime soon.

Does that change anything for Python w.r.t. LibreSSL support?

@dhewg
Copy link

dhewg commented Jul 19, 2022

Of course I stumble upon this just after posting.
That sounds like it can solve the issue about the missing hashing functions?

@tiran
Copy link
Member

tiran commented Jul 19, 2022

It is unlikely that we will officially support LibreSSL. Even if LibreSSL would become feature compatible with OpenSSL, we just don't have to resources to test and verify that Python works correctly with LibreSSL.

Is LibreSSL still relevant? AFAIK only OpenBSD uses it. All Linux distros have dropped support for LibreSSL, even Gentoo. FreeBSD uses OpenSSL and NetBSD seems to prefer OpenSSL as well (they have OpenSSL 1.1.1n and LibreSSL 2.7.4 from 2018).

@dhewg
Copy link

dhewg commented Jul 19, 2022

OpenBSD and to some extend OpenWrt. The patch I linked to is that user maintained Gentoo LibreSSL overlay, which was mentioned in that news item you linked to. Seems used but nothing official.

The usage in OpenWrt in somewhat special. A host python is compiled with LibreSSL, which is then used to cross compile the target python and target python packages, but that's all using OpenSSL then. So the host python with LibreSSL isn't something critical that gets shipped.

And that got us to the question of how painful it is to maintain the python+libressl patch or if OpenWrt should switch the host part to OpenSSL.

@dhewg
Copy link

dhewg commented Dec 30, 2022

For the record: Python 3.10.7 builds with LibreSSL 3.7.0 without any further patches.

@hugovk hugovk removed the needs backport to 3.10 only security fixes label Apr 7, 2023
@arhadthedev
Copy link
Member

If no deliberate removal of LibreSSL calls is planned, should we keep this PR and its parent issue open?

@arhadthedev arhadthedev added the pending The issue will be closed if no feedback is provided label Apr 9, 2023
@orbea
Copy link

orbea commented Apr 16, 2023

All Linux distros have dropped support for LibreSSL, even Gentoo.

It is still possible to use it on Gentoo with the overlay. https://github.com/gentoo/libressl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review needs backport to 3.11 bug and security fixes pending The issue will be closed if no feedback is provided stale Stale PR or inactive for long period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants