Skip to content

tests: Fix TLS tests with Python 3.13 #1568

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 1 commit into from
Mar 27, 2025
Merged

Conversation

ac000
Copy link
Member

@ac000 ac000 commented Mar 5, 2025

    tests: Fix TLS tests with Python 3.13
    
    Python 3.13 sets the VERIFY_X509_STRICT flag by default in
    create_default_context().
    
    This breaks our TLS tests with dummy certificates. Remove this flag.
    
    Thanks to @zfouts for the hint about the flag.
    
    As an aside there is another Python 3.13 change which breaks the tests,
    in that the cgi module has been removed. However there is a legacy-cgi
    module you can install to get things going again (note this module is
    unmaintained). E.g. In Fedora 'dnf install python3-legacy-cgi'.
    
    Reported-by: Konstantin Pavlov <[email protected]>
    Closes: https://github.com/nginx/unit/issues/1545
    Link: <https://docs.python.org/3/whatsnew/3.13.html#ssl>
    Link: <https://docs.python.org/3.13/library/cgi.html>
    Signed-off-by: Andrew Clayton <[email protected]>

@ac000 ac000 linked an issue Mar 5, 2025 that may be closed by this pull request
@ac000 ac000 marked this pull request as ready for review March 5, 2025 18:46
@ac000 ac000 requested a review from thresheek March 5, 2025 18:46
Copy link
Member

@thresheek thresheek left a comment

Choose a reason for hiding this comment

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

The tests pass now for me on Fedora 41!

@ac000
Copy link
Member Author

ac000 commented Mar 27, 2025

Great! Thanks for testing!

Python 3.13 sets the VERIFY_X509_STRICT flag by default in
create_default_context().

This breaks our TLS tests with dummy certificates. Remove this flag.

Thanks to @zfouts for the hint about the flag.

As an aside there is another Python 3.13 change which breaks the tests,
in that the cgi module has been removed. However there is a legacy-cgi
module you can install to get things going again (note this module is
unmaintained). E.g. In Fedora 'dnf install python3-legacy-cgi'.

Reported-by: Konstantin Pavlov <[email protected]>
Closes: nginx#1545
Link: <https://docs.python.org/3/whatsnew/3.13.html#ssl>
Link: <https://docs.python.org/3.13/library/cgi.html>
Signed-off-by: Andrew Clayton <[email protected]>
@ac000
Copy link
Member Author

ac000 commented Mar 27, 2025

Rebased with master

@ac000 ac000 merged commit 3b18ffe into nginx:master Mar 27, 2025
@ac000 ac000 deleted the pytest-tls-fix branch March 27, 2025 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests fail with Python 3.13 on Fedora 41
2 participants