1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ldapsearch result: Can't contact LDAP server (-1)

Discussion in 'Main Forum' started by Neil, Sep 12, 2018.

  1. Neil

    Neil Guest

    Anyone knows which the problem?

    I installed LDAP: yum -y install openldap-servers and then checked is the installation work well starting slapd service and doing ldapsearch like this:

    ldapsearch -h -x -b '' -s base '(objectclass=*)' namingContexts -d1


    ldap_new_connection 1 1 0
    ldap_connect_to_host: TCP
    ldap_new_socket: 3
    ldap_prepare_socket: 3
    ldap_connect_to_host: Trying
    ldap_pvt_connect: fd: 3 tm: -1 async: 0
    attempting to connect:
    connect success
    ldap_open_defconn: successful
    ber_scanf fmt ({it) ber:
    ber_scanf fmt ({i) ber:
    ber_flush2: 14 bytes to sd 3
    ldap_result ld 0x7f7d211a4350 msgid 1
    wait4msg ld 0x7f7d211a4350 msgid 1 (infinite timeout)
    wait4msg continue ld 0x7f7d211a4350 msgid 1 all 1
    ** ld 0x7f7d211a4350 Connections:
    * host: port: 389 (default)
    refcnt: 2 status: Connected
    last used: Mon Jan 26 12:05:16 2015

    ** ld 0x7f7d211a4350 Outstanding Requests:
    * msgid 1, origid 1, status InProgress
    outstanding referrals 0, parent count 0
    ld 0x7f7d211a4350 request count 1 (abandoned 0)
    ** ld 0x7f7d211a4350 Response Queue:
    ld 0x7f7d211a4350 response count 0
    ldap_chkResponseList ld 0x7f7d211a4350 msgid 1 all 1
    ldap_chkResponseList returns ld 0x7f7d211a4350 NULL
    read1msg: ld 0x7f7d211a4350 msgid 1 all 1
    ldap_result: Can't contact LDAP server (-1)
    ldap_free_request (origid 1, msgid 1)
    ldap_free_connection 1 1
    ldap_free_connection: actually freed

    After that I've tried to configure LDAP but the problem it's the same. And I started from scratch and then I asked with this question.

    My 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://ldap-master.example.com:666

    #DEREF never

    TLS_CACERTDIR /etc/openldap/certs

    # Turning this off breaks GSSAPI used with krb5 when rdns = false

    Is it a problem of my Centos 7 server?


    I checked and I can't ping to localhost: ping localhost or ping may be is the problem. How can I solve it?

    New Edit:

    Ping is not the problem. Now I can ping but still not works. Only works ldapsearch like this:

    ldapsearch -H ldapi:/// -x -b '' -s base '(objectclass=*)' namingContexts

    Login To add answer/comment

Share This Page