Python+LDAP+SSL

前端 未结 2 431
鱼传尺愫
鱼传尺愫 2020-12-13 15:33

Good day.

In advance to apologize for my English, my national forums and resources did not help.

There was a need in the script that changes (or creates) a

2条回答
  •  隐瞒了意图╮
    2020-12-13 16:27

    After studying like this, I found a solution on their own

    ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)
    l = ldap.initialize("ldaps://ldap:636")
    l.set_option(ldap.OPT_REFERRALS, 0)
    l.set_option(ldap.OPT_PROTOCOL_VERSION, 3)
    l.set_option(ldap.OPT_X_TLS,ldap.OPT_X_TLS_DEMAND)
    l.set_option( ldap.OPT_X_TLS_DEMAND, True )
    l.set_option( ldap.OPT_DEBUG_LEVEL, 255 )
    l.simple_bind_s("admin@tester.com","password")
    

提交回复
热议问题