0. Need two versions of openldap : one compiled with gnutls, the other with
openssl.
1. Create a V1 CA.
2. Create a certificate to be used by slapd and sign it with the V1 CA.
3. Configure a slapd+openssl system with certificates issues above.
4. Try to connect to the slapd+openssl system with a libldap+gnutls client:
Note that a possible workaround is to put *all* of the CA certificates from the chain in the TLS_CACERT file. If one of the intermediate CA certs is a V3 certificate gnutls shouldn't fail and the ldap connection should proceed.
This is actually mentioned in the Admin guide:
16.2.2.1. TLS_CACERT <filename>
This is equivalent to the server's TLSCACertificateFile option. As noted in the TLS Configuration section, a client typically may need to know about more CAs than a server, but otherwise the same considerations apply.
which points to section 16.2.1.1. TLSCACertificateFile <filename>:
If the signing CA was not a top-level (root) CA, certificates for the entire sequence of CA's from the signing CA to the top-level CA should be present.
I was able to reproduce the libldap client bug:
0. Need two versions of openldap : one compiled with gnutls, the other with
openssl.
1. Create a V1 CA.
2. Create a certificate to be used by slapd and sign it with the V1 CA.
3. Configure a slapd+openssl system with certificates issues above.
4. Try to connect to the slapd+openssl system with a libldap+gnutls client:
mathiaz@ t-slapd- gnutls: ~$ ldapsearch -b "dc=vmnet" -D "cn=admin,dc=vmnet" -x -w /t-slapd- openssl. / -d 1 parse_ext( ldaps:/ /t-slapd- openssl. /) parse_ext( ldaps:/ /t-slapd- openssl. :636/?? base) initial_ request open_connection to_host: TCP t-slapd- openssl. :636 socket: 3 to_host: Trying 172.19.42.220:636 bind(SIMPLE) : Can't contact LDAP server (-1)
mypwd -H ldaps:/
ldap_url_
ldap_create
ldap_url_
ldap_sasl_bind
ldap_send_
ldap_new_connection 1 1 0
ldap_int_
ldap_connect_
ldap_new_socket: 3
ldap_prepare_
ldap_connect_
ldap_pvt_connect: fd: 3 tm: -1 async: 0
TLS: peer cert untrusted or revoked (0x82)
TLS: can't connect: (unknown error code).
ldap_err2string
ldap_sasl_
I've filed a bug in openldap bug tracker: www.OpenLDAP. org/its/ index.cgi? findid= 5992
http://
Note that a possible workaround is to put *all* of the CA certificates from the chain in the TLS_CACERT file. If one of the intermediate CA certs is a V3 certificate gnutls shouldn't fail and the ldap connection should proceed.
This is actually mentioned in the Admin guide:
16.2.2.1. TLS_CACERT <filename>
This is equivalent to the server's TLSCACertificat eFile option. As noted in the TLS Configuration section, a client typically may need to know about more CAs than a server, but otherwise the same considerations apply.
which points to section 16.2.1.1. TLSCACertificat eFile <filename>:
If the signing CA was not a top-level (root) CA, certificates for the entire sequence of CA's from the signing CA to the top-level CA should be present.