0

I understand that there is a known issue starting from Python 3.10 and above with OpenSSL. I also comprehend that this can be resolved using the wrapper library "pyOpenSSL." However, I did not find any resources demonstrating a proper example of authenticating a user to LDAP using this library.

This is my code that works for all Python 3.9 and below. I need to make it works in new versions of Python. currently, it's raising the error:

("('socket ssl wrapping error: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1007)',)",)

    try:
        user_conn = ldap3.Connection(server, user=user_dn, password=user_password, raise_exceptions=True, auto_bind=ldap3.AUTO_BIND_NONE)
        user_conn.open()
        bind_res = user_conn.bind()
        print("Authentication successful. " + str(bind_res))
        user_conn.unbind()
    except Exception as e:
        print(e)

Thanks for any help!

Izik
  • 746
  • 1
  • 9
  • 25

0 Answers0