www.centos.org Forum Index CentOS 6 - Software Support Issues using startTLS with Openldap 2.4.23
|
Bottom Previous Topic Next Topic |
| |
|
|
|---|
| Poster | Thread |
|---|
|
Re: Issues using startTLS with Openldap 2.4.23 | #2 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2009/9/24
From Brighton, UK
Posts: 6310
|
Use TLS_CACERTDIR and then show the output from `ls -la` of that directory please. If you could wrap that output in [code][/code] tags then that would make it more readable.
|
||
|
_________________
Linux/VoIP Systems Administrator |
|||
Posted on: 2011/12/2 23:48
|
|||
|
Re: Issues using startTLS with Openldap 2.4.23 | #3 |
|
|---|---|---|---|
|
Newbie
![]()
Joined: 2011/12/2
From
Posts: 5
|
Here is the contents of my /etc/openldap/ldap.conf file:
cat /etc/openldap/ldap.conf # # LDAP Defaults # # See ldap.conf(5) for details # This file should be world readable but not world writable. #BASE dc=example, dc=com #URI ldap://ldap.example.com ldap://ldap-master.example.com:666 #SIZELIMIT 12 #TIMELIMIT 15 #DEREF never URI ldap://localhost/ BASE dc=localdomain,dc=com #TLS_CACERT /etc/openldap/cacerts/cacert.pem TLS_CACERTDIR /etc/openldap/cacerts #TLS_REQCERT demand TLS_REQCERT never Here is the contents of my /etc/openldap/cacerts directory. /etc/openldap/cacerts [root@localhost cacerts]# ls -la total 1252 drwxr-xr-x 2 ldap ldap 4096 Dec 5 15:10 . drwxr-xr-x 5 ldap ldap 4096 Dec 2 20:44 .. -rw-r--r-- 1 root root 571410 Dec 2 20:51 ca-bundle.crt -rw-r--r-- 1 root root 651043 Dec 2 20:51 ca-bundle.trust.crt -rw-r--r-- 1 root root 4954 Dec 2 20:49 cacert.pem -rw-r--r-- 1 root root 4951 Dec 2 20:49 cacert.pem.bakup -rw-r--r-- 1 root root 29836 Dec 5 15:09 log |
||
Posted on: 2011/12/5 15:18
|
|||
|
Re: Issues using startTLS with Openldap 2.4.23 | #4 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2009/9/24
From Brighton, UK
Posts: 6310
|
Right. To get your CA cert recognised it has to exist as a filename that is the same as the hash of it! So if you run
then it should spit out something like Quote:
I find the easiest thing to do is to create a symlink (substituting your hash for the symlink name of course) |
||
|
_________________
Linux/VoIP Systems Administrator |
|||
Posted on: 2011/12/5 15:40
|
|||
|
Re: Issues using startTLS with Openldap 2.4.23 | #5 |
|
|---|---|---|---|
|
Newbie
![]()
Joined: 2011/12/2
From
Posts: 5
|
Thanks for the tip. I tried what you suggested but it still doesn't work. I checked my cacert with openssl and everything appears to be okay.
Openssl Verify: openssl verify -CAfile /etc/openldap/cacerts/cacert.pem /etc/pki/tls/certs/slapd.pem /etc/pki/tls/certs/slapd.pem: OK /etc/openldap/cacerts [root@localhost cacerts]# ls -la total 16 drwxr-xr-x 2 ldap ldap 4096 Dec 5 16:21 . drwxr-xr-x 5 ldap ldap 4096 Dec 2 20:44 .. lrwxrwxrwx 1 root root 10 Dec 5 16:19 18945410.0 -> cacert.pem -rw-r--r-- 1 root root 4954 Dec 2 20:49 cacert.pem # ldapsearch -LL -d1 -v -x -W -D 'cn=Manager,dc=localdomain,dc=com' -H ldap://localhost -ZZ '(cn=*)' ldap_url_parse_ext(ldap://localhost) ldap_initialize( ldap://localhost:389/??base ) ldap_create ldap_url_parse_ext(ldap://localhost:389/??base) ldap_extended_operation_s ldap_extended_operation ldap_send_initial_request ldap_new_connection 1 1 0 ldap_int_open_connection ldap_connect_to_host: TCP localhost:389 ldap_new_socket: 3 ldap_prepare_socket: 3 ldap_connect_to_host: Trying 127.0.0.1:389 ldap_pvt_connect: fd: 3 tm: -1 async: 0 ldap_open_defconn: successful ldap_send_server_request ber_scanf fmt ({it) ber: ber_scanf fmt ({) ber: ber_flush2: 31 bytes to sd 3 ldap_result ld 0x15b6320 msgid 1 wait4msg ld 0x15b6320 msgid 1 (infinite timeout) wait4msg continue ld 0x15b6320 msgid 1 all 1 ** ld 0x15b6320 Connections: * host: localhost port: 389 (default) refcnt: 2 status: Connected last used: Mon Dec 5 16:25:18 2011 ** ld 0x15b6320 Outstanding Requests: * msgid 1, origid 1, status InProgress outstanding referrals 0, parent count 0 ld 0x15b6320 request count 1 (abandoned 0) ** ld 0x15b6320 Response Queue: Empty ld 0x15b6320 response count 0 ldap_chkResponseList ld 0x15b6320 msgid 1 all 1 ldap_chkResponseList returns ld 0x15b6320 NULL ldap_int_select read1msg: ld 0x15b6320 msgid 1 all 1 ber_get_next ber_get_next: tag 0x30 len 12 contents: read1msg: ld 0x15b6320 msgid 1 message type extended-result ber_scanf fmt ({eAA) ber: read1msg: ld 0x15b6320 0 new referrals read1msg: mark request completed, ld 0x15b6320 msgid 1 request done: ld 0x15b6320 msgid 1 res_errno: 0, res_error: <>, res_matched: <> ldap_free_request (origid 1, msgid 1) ldap_parse_extended_result ber_scanf fmt ({eAA) ber: ldap_parse_result ber_scanf fmt ({iAA) ber: ber_scanf fmt (}) ber: ldap_msgfree TLS: loaded CA certificate file /etc/openldap/cacerts/18945410.0 from CA certificate directory /etc/openldap/cacerts. TLS: file cacert.pem does not end in [.0] - does not appear to be a CA certificate directory file with a properly hashed file name - skipping. TLS: error: connect - force handshake failure: errno 0 - moznss error -5938 TLS: can't connect: TLS error -5938:Encountered end of file. ldap_err2string ldap_start_tls: Connect error (-11) additional info: TLS error -5938:Encountered end of file Anyone have any other ideas? Thanks, Duain |
||
Posted on: 2011/12/5 16:27
|
|||
|
Re: Issues using startTLS with Openldap 2.4.23 | #6 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2009/9/24
From Brighton, UK
Posts: 6310
|
You got an error there with an error code -5938. Googling that takes me to a redhat bugzilla that talks about making sure that your CA cert really is a CA cert by running
You might also find it useful to try connecting to port 636 with an ldaps:// address until you get the certificate error out of the way - I think it may give better error messages that way. |
||
|
_________________
Linux/VoIP Systems Administrator |
|||
Posted on: 2011/12/5 17:14
|
|||
|
Re: Issues using startTLS with Openldap 2.4.23 | #7 |
|
|---|---|---|---|
|
Newbie
![]()
Joined: 2011/12/2
From
Posts: 5
|
I verified my cacert with that command. I believe the relevant part is
X509v3 Basic Constraints: CA:TRUE I believe my certificates are fine. I think the issue has something to do with the Moznss vs openssl compatibility issue, but other than running a different version of openldap server I don't see a work around to this issue. |
||
Posted on: 2011/12/5 21:17
|
|||
|
Re: Issues using startTLS with Openldap 2.4.23 | #8 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2009/9/24
From Brighton, UK
Posts: 6310
|
You are connecting to ldap://localhost but the certificate belongs to the name of the server which is not localhost. Try talking to ldap://the-name.on.the.certificate
|
||
|
_________________
Linux/VoIP Systems Administrator |
|||
Posted on: 2011/12/5 23:36
|
|||
|
Re: Issues using startTLS with Openldap 2.4.23 | #9 |
|
|---|---|---|---|
|
Newbie
![]()
Joined: 2012/2/24
From
Posts: 1
|
Hi,
I am experiencing the exact same problem, and would be very interested to know if someone has found a solution. I have posted on the OpenLDAP forum here: http://www.openldap.org/lists/openldap-technical/201202/threads.html#00359 As per the previous suggestion by TrevorH, I am using the CN of the certificate in my ldapsearch bind, as opposed to localhost. This does not make any difference. Thanks |
||
Posted on: 2012/2/24 17:38
|
|||
Top Previous Topic Next Topic |
|



Topic options
Print Topic
Threaded
Newest First
dchrist




You cannot start a new topic.
You can view topic.