在身份验证期间如何传递安全密钥而不是文件?
对于文件来说,它对我有用,但是我很难传递安全密钥。有可能吗?
证书文件的代码:
l = ldap.initialize('ldaps://localhost636')
print(ldap.get_option(ldap.OPT_X_TLS_CACERTFILE))
# ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, 'C:\\Users\\DE00030688\\Desktop\\MicrosoftLDAPS\\LDAPSEC2.cer')
username = "localhost@test.com"
password = "Qwer1234$!"
try:
l.protocol_version = ldap.VERSION3
l.simple_bind_s(username, password)
except Exception as e:
print("******Exception in LDAP Connection******** " + e)
return l