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_tls_ext_noca fails when python3 is built againts openssl3 #501

Open
mweinelt opened this issue Nov 14, 2022 · 0 comments
Open

test_tls_ext_noca fails when python3 is built againts openssl3 #501

mweinelt opened this issue Nov 14, 2022 · 0 comments

Comments

@mweinelt
Copy link

If you found a bug in python-ldap, or would request a new feature,
this is the place to let us know.

Please describe the issue and your environment here.


Issue description:

We see test_tls_ext_noca fail when Python is built against OpenSSL 3.0.


_____________________ TestLdapCExtension.test_tls_ext_noca _____________________

self = <Tests.t_cext.TestLdapCExtension testMethod=test_tls_ext_noca>

    @requires_tls()
    def test_tls_ext_noca(self):
        l = self._open_conn(bind=False)
        l.set_option(_ldap.OPT_PROTOCOL_VERSION, _ldap.VERSION3)
        # fails because libldap defaults to secure cert validation but
        # the test CA is not installed as trust anchor.
        with self.assertRaises(_ldap.CONNECT_ERROR) as e:
            l.start_tls_s()
        # known resaons:
        # Ubuntu on Travis: '(unknown error code)'
        # OpenSSL 1.1: error:1416F086:SSL routines:\
        #    tls_process_server_certificate:certificate verify failed
        # NSS: TLS error -8172:Peer's certificate issuer has \
        #    been marked as not trusted by the user.
        msg = str(e.exception)
        candidates = ('certificate', 'tls', '(unknown error code)')
        if not any(s in msg.lower() for s in candidates):
>           self.fail(msg)
E           AssertionError: {'result': -11, 'desc': 'Connect error', 'ctrls': [], 'info': 'error:16000069:STORE routines::unregistered scheme'}

Tests/t_cext.py:916: AssertionError

Steps to reproduce:

Build Python with OpenSSL 3 and run the testsuite.

Operating system: Linux (NixOS Unstable)

Python version: 3.10.8

python-ldap version: 3.4.3

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

1 participant