我有一个运行openldap的Debian 6.0.5服务器。 它似乎是针对gnutls编译的。 我使用gnutls的certtool来生成一个自签名证书,我已经在一些debian客户端机器上使用它来对openldap服务器进行身份validation。
但是,当我尝试在CentOS 6客户端上执行相同的操作时,出现以下ldapsearch错误:
ldap_initialize( <DEFAULT> ) ldap_start_tls: Can't contact LDAP server (-1) additional info: TLS error -8101:Certificate type not approved for application. ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
如果我在CentOS客户端上运行gnutls-cli-debug,我得到以下结果:
gnutls-cli-debug -p 636 ldap.blahblah.com Resolving 'ldap.blahblah.com'... Connecting to '10.6.0.11:636'... Error in %INITIAL_SAFE_RENEGOTIATION Checking for Safe renegotiation support...
就这样 – 它死了。
有没有人能够在这种types的设置ldaps,gnutls链接的服务器,gnutls生成的证书,openssl链接的客户端?
谢谢!
我猜你可以通过以下两种方式之一来攻击这个问题:让ldapsearch
客户端使用您现有的证书工作,或者生成喜欢的新证书。 我个人认为,修改你的服务器证书比改变ldapsearch
代码更容易,所以这就是我所看到的。
上面的错误表明,服务器端证书中缺less一些东西(例如,客户端不想与服务器通信,因为它没有正确识别)。
对于初学者,我检查了随机LDAP服务器使用的证书,在这种情况下是directory.washington.edu
。 如果你拿到证书,例如:
openssl s_client -connect directory.washington.edu:636 > dirwash.crt
然后做:
openssl x509 -in dirwash.crt -text
你会看到的:
X509v3 Key Usage: Digital Signature, Non Repudiation, Key Encipherment, Data Encipherment X509v3 Extended Key Usage: TLS Web Client Authentication, TLS Web Server Authentication
其他LDAP服务器(例如ldap.virginia.edu
)根本没有这些扩展。 其他人,如ldap.itd.umich.edu
有以上变化:
X509v3 Key Usage: Digital Signature, Key Encipherment X509v3 Extended Key Usage: TLS Web Server Authentication, TLS Web Client Authentication
简而言之,我build议你检查一下你的服务器证书 – 如果你愿意的话,可以把它放在这里 – 看看它是否包含X509v3 (Extended) Key Usage
扩展,如果是的话,是否看起来像在其他LDAP服务器上使用的那些证书。
我看到一个邮件主题 ,提示:(1)扩展名应该不存在; 或(2)如果扩展名存在,则至less需要包含TLS Web Server Authentication
。 我不知道在这种情况下是否属实,但无论如何要考虑。