我的证书不适用于所有机器

我在我的新品牌服务器上安装了Centos7。 我使用LDAP作为身份validation。 我在所有服务器上部署了我的证书,LDAPS正在与RHEL5,Debian或SOLARIS合作

在Centos7上,我遇到了sssd问题,在安装之前我不知道。 LDAP正在工作,我可以做su – $用户。 当我在LDAPS中升级时,我丢失了这个authentication。 在我的LDAP服务器上,我有这个错误:

[30/oct./2014:16:32:05 +0100] DISCONNECT conn=735741 reason="Protocol Error" msg="The client sent a request to Directory Server which did not decode well as LDAP message : javax.net.ssl.SSLException: Received fatal alert: bad_certificate" 

为什么相同的证书在另一台服务器上工作,而不是在这台服务器上

感谢您的回答。


谢谢BillThor,

但系统似乎这样做,因为与哈希返回的符号链接已创build。 顺便说一句,我在ldap.conf中修改了这一行

 TLS_CACERT /etc/openldap/cacerts/xxxxxx.0 

我用ldapsearch -x -d3命令testing了一下,我得到了这个错误信息:

  attempting to connect: connect success TLS: loaded CA certificate file /etc/openldap/cacerts/xxxxxx.0. tls_write: want=157, written=157 .../... certificate is not valid - error -8016:The certificate was signed using a signature algorithm that is disabled because it is not secure TLS: error: connect - force handshake failure: errno 0 - moznss error -8157 TLS: can't connect: TLS error -8157:Certificate extension not found.. ldap_err2string 

这很奇怪,因为我的所有服务器都接受这个CA,但不是CENTOS7下的新的任何想法来自哪里?


我认为这一点可能是关键:

 certificate is not valid - error -8016:The certificate was signed using a signature algorithm that is disabled because it is not secure 

我的猜测是拒绝该证书的服务器可能被configuration为不接受基于SHA-1的签名。 我不是密码学家,而是最近引起我注意的其他SSL问题,我没有想到其他人似乎适合。

你应该猜测一下有关的细节,但应该记住这个服务器拒绝你的证书的原因是有根据的,而且它是接受证书的服务器应该有它们的configuration审查。

编辑:有更多的问题的描述,以及这里为ldapsearch的解决方法: https ://bugzilla.redhat.com/show_bug.cgi ? id = 895513。

看起来问题可能是MD5,而不是我猜测的SHA-1。 看来,从ldapsearch 3.14:

 Certificate signatures that make use of the MD5 hash algorithm will now be rejected by default. Support for MD5 may be manually enabled (but is discouraged) by setting the environment variable of "NSS_HASH_ALG_SUPPORT=+MD5" or by using the NSS_SetAlgorithmPolicy function. Note that SSL cipher suites with "MD5" in their names are NOT disabled by this change; those cipher suites use HMAC-MD5, not plain MD5, and are still considered safe. 

鉴于您的错误是在服务器上,您可能只能解决在该系统上的问题。

如果问题出在MD5上,我build议你在采取这种方法之前仔细考虑。 对MD5证书的攻击是非常实际的,如果你没有摆脱MD5证书,你应该问为什么你运行一个CA。

http://www.win.tue.nl/hashclash/rogue-ca/

如果这是关于SHA-1的新问题,那么攻击就更困难了,是否可行取决于CA签名密钥的长度。

除了部署证书外,您可能还需要为证书创build一个符号链接。 c_rehash提供了c_rehash实用程序。 您也可以使用命令openssl x509 -noout -hash -in vsignss.pem来获取证书的哈希值。 符号链接有一个.0后缀。

或者,您可以将证书添加到您的LDAPconfiguration。 这可能是/etc/ldap/ldap.conf 。 旧版本在pam_ldap.conf也有设置。

编辑:握手错误可能是禁用SSLv3或以其他方式限制可用algorithm的结果。 由于Poodle漏洞,我最近禁用了SLLv3 。 我在最后包含了我用来testing连接的命令。 在你的情况下尝试一个命令,如:

 openssl s_client -connect localhost:ldap openssl s_client -quiet -connect localhost:ldap -ssl3 openssl s_client -quiet -connect localhost:ldap -tls1 openssl s_client -quiet -connect localhost:ldap -tls1_2 

您没有指出如何安装CA证书文件。 在使用RH或衍生产品时,您可以使用man update-ca-trust中的信息,tldr; 版本是:

  1. 将CA证书文件复制到/ etc / pki / ca-trust / source / anchors /
  2. 运行update-ca-trust enable && update-ca-trust
  3. 利润!

update-ca-trust随基础存储库中的软件包ca-certificates一起提供。

这应该几乎处理所有事情。 根据我的经验,只有php是特殊的,需要在/etc/openldap/ldap.conf(系统范围)或$ HOME / .ldaprc(仅针对一个用户)中指定特别注意:

TLS_CACERT /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem

顺便说一句,这个TLS_CACERTpath是update-ca-trust工具所pipe理的。

伙计,感谢所有。

我发现这些链接:

https://bugzilla.redhat.com/show_bug.cgi?id=895513

和这个 :

http://www.unixmen.com/rhel-centos-6-4-ldap-md5-certificate-error-caused-by-nss-3-14-update/

我在testing这个解决scheme时遇到了一个问题,那就是如何在GRUB2中join这一行

 systemd.setenv=NSS_HASH_ALG_SUPPORT=+MD5 

所以,我已经得到了答案: 在grub2中添加systemd setenv

谢谢。