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

Test failures with OpenSSL 3 #345

Closed
mweinelt opened this issue Nov 19, 2022 · 3 comments
Closed

Test failures with OpenSSL 3 #345

mweinelt opened this issue Nov 19, 2022 · 3 comments

Comments

@mweinelt
Copy link

Hi! With 0.9.20 we're seeing the following test failures after switching to OpenSSL 3.

============================= test session starts ==============================
platform linux -- Python 3.10.8, pytest-7.1.3, pluggy-1.0.0
rootdir: /build/aioquic-0.9.20
collected 385 items                                                            

tests/test_asyncio.py ..........................                         [  6%]
tests/test_buffer.py .........................                           [ 13%]
tests/test_connection.py ............................................... [ 25%]
................................................................         [ 42%]
tests/test_crypto.py ............                                        [ 45%]
tests/test_crypto_draft_29.py ...........                                [ 48%]
tests/test_h0.py ...                                                     [ 48%]
tests/test_h3.py ........................................                [ 59%]
tests/test_logger.py ....                                                [ 60%]
tests/test_packet.py ..........................                          [ 67%]
tests/test_packet_builder.py ................                            [ 71%]
tests/test_rangeset.py .....................                             [ 76%]
tests/test_recovery.py .......                                           [ 78%]
tests/test_retry.py .                                                    [ 78%]
tests/test_stream.py ............................                        [ 85%]
tests/test_tls.py .......F..................................FF...        [ 98%]
tests/test_webtransport.py .......                                       [100%]

=================================== FAILURES ===================================
______________ ContextTest.test_handshake_with_certificate_error _______________

self = <tests.test_tls.ContextTest testMethod=test_handshake_with_certificate_error>

    def test_handshake_with_certificate_error(self):
        client = self.create_client(cafile=None)
        server = self.create_server()
    
        with self.assertRaises(tls.AlertBadCertificate) as cm:
            self._handshake(client, server)
>       self.assertEqual(str(cm.exception), "unable to get local issuer certificate")
E       AssertionError: 'a' != 'unable to get local issuer certificate'
E       - a
E       + unable to get local issuer certificate

tests/test_tls.py:433: AssertionError
_____________ VerifyCertificateTest.test_verify_certificate_chain ______________

self = <tests.test_tls.VerifyCertificateTest testMethod=test_verify_certificate_chain>

    def test_verify_certificate_chain(self):
        with open(SERVER_CERTFILE, "rb") as fp:
            certificate = load_pem_x509_certificates(fp.read())[0]
    
        with patch("aioquic.tls.utcnow") as mock_utcnow:
            mock_utcnow.return_value = certificate.not_valid_before
    
            # fail
            with self.assertRaises(tls.AlertBadCertificate) as cm:
                verify_certificate(certificate=certificate, server_name="localhost")
>           self.assertEqual(
                str(cm.exception), "unable to get local issuer certificate"
            )
E           AssertionError: 'a' != 'unable to get local issuer certificate'
E           - a
E           + unable to get local issuer certificate

tests/test_tls.py:1268: AssertionError
_______ VerifyCertificateTest.test_verify_certificate_chain_self_signed ________

self = <tests.test_tls.VerifyCertificateTest testMethod=test_verify_certificate_chain_self_signed>

    def test_verify_certificate_chain_self_signed(self):
        certificate, _ = generate_ec_certificate(
            common_name="localhost", curve=ec.SECP256R1
        )
    
        with patch("aioquic.tls.utcnow") as mock_utcnow:
            mock_utcnow.return_value = certificate.not_valid_before
    
            # fail
            with self.assertRaises(tls.AlertBadCertificate) as cm:
                verify_certificate(certificate=certificate, server_name="localhost")
>           self.assertEqual(str(cm.exception), "self signed certificate")
E           AssertionError: 'l' != 'self signed certificate'
E           - l
E           + self signed certificate

tests/test_tls.py:1290: AssertionError
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Mar 20, 2023
@mweinelt
Copy link
Author

Still relevant

@github-actions github-actions bot removed the stale label Mar 21, 2023
@jlaine
Copy link
Contributor

jlaine commented Apr 2, 2023

This was fixed in #349

@jlaine jlaine closed this as completed Apr 2, 2023
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

No branches or pull requests

2 participants