1

我的 LDAP 身份验证停止工作并出现以下错误:

{'info': 'The signature algorithm is not supported.', 'desc': "Can't contact LDAP server"}

它以前可以工作,并且相同的代码仍然可以在 OSx 和 RHEL7 上工作。它在我的 Ubuntu 14.04 上不起作用。

下面的代码模仿了这个问题:

ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)
l = ldap.initialize(url)
l.simple_bind_s(username,pwd)

我知道这使用自签名证书。我想知道该证书是否存在物理位置。删除它可能会解决问题。

任何帮助,将不胜感激。

编辑:

正如 Julien 所建议的,这看起来更像是一个 LDAP 问题......使用 ldapsearch 我得到了相同的错误消息:

$ ldapsearch -H ldaps://xxx.xxx.gov/ -b "OU=xxx" -x -d1
ldap_url_parse_ext(ldaps://xxx.xxx.gov/)
ldap_create
ldap_url_parse_ext(ldaps://xxx.xxx.gov:636/??base)
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP xxx.xxx.gov:636
ldap_new_socket: 3
ldap_prepare_socket: 3
ldap_connect_to_host: Trying 128.219.164.41:636
ldap_pvt_connect: fd: 3 tm: -1 async: 0
TLS: can't connect: The signature algorithm is not supported..
ldap_err2string
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
4

2 回答 2

1

这是一个 LDAP(GNU TLS)问题,而不是 python。gnutls26 安全更新禁用了 md5 支持。要检查您的服务器是否使用 md5 证书,请运行:

openssl s_client -showcerts -connect xxx.xxx.xx:636 < /dev/null |  openssl x509 -noout -text > cert.txt

$ cat cert.txt | grep -i signature
Signature Algorithm: md5WithRSAEncryption
Signature Algorithm: md5WithRSAEncryption

同时,解决方案是降级 gnutls26 或更改(如果可以)您的 LDAP 服务器提供的证书。

于 2016-01-18T13:22:32.283 回答
0

太奇怪了,从今天开始我有同样的问题。我已经更新了我的 Ubuntu 14.04,从那以后,我无法在 PHP 中连接到我的 LDAP 服务器。

经过一番挖掘,我在 ldapsearch 中遇到了与您相同的错误:

ldapsearch -H ldaps://172.22.5.52/ -b "OU=XXX" -x -d5
ldap_url_parse_ext(ldaps://172.22.5.52/)
ldap_create
ldap_url_parse_ext(ldaps://172.22.5.52:636/??base)
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP 172.22.5.52:636
ldap_new_socket: 3
ldap_prepare_socket: 3
ldap_connect_to_host: Trying 172.22.5.52:636
ldap_pvt_connect: fd: 3 tm: -1 async: 0
TLS: can't connect: The signature algorithm is not supported..
ldap_err2string
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

你的帖子让我觉得一个数据包似乎坏了......

于 2016-01-14T15:03:27.047 回答