Skip to content

test_ssl.test_min_max_version fails when OpenSSL has TLS 1.0/1.1 disabled. #144787

Closed

Description

@colin-pm

Bug report

Bug description:

The test_min_max_version test in test_ssl.py fails on systems where OpenSSL is compiled with no-tls1 and no-tls1_1 options. TLS 1.0 and 1.1 have been deprecated by the IETF since 2021. Disabling TLS v1 and v1.1 is a legitimate configuration used for security-hardened builds.

The following assertion in test_min_max_version expects ctx.maximum_version to be in the set {TLSv1, TLSv1_1, SSLv3} when set to MINIMUM_SUPPORTED. However, on systems where v1.0 and v1.1 are disabled, OpenSSL picks to the next available lowest version, which is TLS v1.2.

ctx.maximum_version = ssl.TLSVersion.MINIMUM_SUPPORTED
self.assertIn(
    ctx.maximum_version,
    {ssl.TLSVersion.TLSv1, ssl.TLSVersion.TLSv1_1, ssl.TLSVersion.SSLv3}
)

I was able to fix the test by adding ssl.TLSVersion.TLSv1_2 to the set. I can submit a pull request adding this option to the set if that's the best solution, but I'm also happy to discuss alternatives.

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

Activity

  1. added a commit that references this issue on Feb 13, 2026
  2. added 2 commits that reference this issue on Feb 13, 2026
  3. added 2 commits that reference this issue on Feb 13, 2026
  4. gpshead commented on Feb 13, 2026

    @gpshead
    Member

    thanks! (also, neat to finally be in a world where a higher minimum is viable!)

  5. deleted a comment from on Feb 17, 2026
  6. added a commit that references this issue on Feb 28, 2026
  7. added a commit that references this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtopic-SSLtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions