After install openldap on redhat, I can startup the process and access using ldapsearch but cannot access via ssl, I hit errors like below
# ldapsearch -d 1 -x -D "cn=Manager,dc=example,dc=com" -w secret -H ldaps://192.168.16.88 cn
ldap_create
ldap_url_parse_ext(ldaps://192.168.16.88)
ldap_bind
ldap_simple_bind
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP 192.168.16.88:636
ldap_new_socket: 3
ldap_prepare_socket: 3
ldap_connect_to_host: Trying 192.168.16.88:636
ldap_connect_timeout: fd: 3 tm: -1 async: 0
TLS trace: SSL_connect:before/connect initialization
TLS trace: SSL_connect:SSLv2/v3 write client hello A
TLS: can't connect.
ldap_perror
ldap_bind: Can't contact LDAP server (-1)
did a test using openssl to verify if ssl works:
# openssl s_client -connect 192.168.16.88:636
CONNECTED(00000003)
10484:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:188:
# openssl s_client -connect 192.168.16.88:636 -CAfile slapd.pem -key slapd.pem
CONNECTED(00000003)
10034:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:s23_clnt.c:583:
after trouble shooting for awhile, it turns out to be configruation syntax error, there should be no space before each option like below
TLSCACertificateFile /etc/pki/tls/certs/slapd.pem
TLSCertificateFile /etc/pki/tls/certs/slapd.pem
TLSCertificateKeyFile /etc/pki/tls/certs/slapd.pem
but I was configured as
TLSCACertificateFile /etc/pki/tls/certs/slapd.pem
TLSCertificateFile /etc/pki/tls/certs/slapd.pem
TLSCertificateKeyFile /etc/pki/tls/certs/slapd.pem
hope this can help people who hit the same problem
# ldapsearch -d 1 -x -D "cn=Manager,dc=example,dc=com" -w secret -H ldaps://192.168.16.88 cn
ldap_create
ldap_url_parse_ext(ldaps://192.168.16.88)
ldap_bind
ldap_simple_bind
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP 192.168.16.88:636
ldap_new_socket: 3
ldap_prepare_socket: 3
ldap_connect_to_host: Trying 192.168.16.88:636
ldap_connect_timeout: fd: 3 tm: -1 async: 0
TLS trace: SSL_connect:before/connect initialization
TLS trace: SSL_connect:SSLv2/v3 write client hello A
TLS: can't connect.
ldap_perror
ldap_bind: Can't contact LDAP server (-1)
did a test using openssl to verify if ssl works:
# openssl s_client -connect 192.168.16.88:636
CONNECTED(00000003)
10484:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:188:
# openssl s_client -connect 192.168.16.88:636 -CAfile slapd.pem -key slapd.pem
CONNECTED(00000003)
10034:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:s23_clnt.c:583:
after trouble shooting for awhile, it turns out to be configruation syntax error, there should be no space before each option like below
TLSCACertificateFile /etc/pki/tls/certs/slapd.pem
TLSCertificateFile /etc/pki/tls/certs/slapd.pem
TLSCertificateKeyFile /etc/pki/tls/certs/slapd.pem
but I was configured as
TLSCACertificateFile /etc/pki/tls/certs/slapd.pem
TLSCertificateFile /etc/pki/tls/certs/slapd.pem
TLSCertificateKeyFile /etc/pki/tls/certs/slapd.pem
hope this can help people who hit the same problem
Comments
Post a Comment