我试图在ssl/tls连接上使用ldapsearch,但它不起作用:
ldapsearch -ZZ -d 5 -b "cn=Users,dc=my,dc=server,dc=com" -s sub -D
"cn=mydevice,cn=Users,dc=my,dc=server,dc=com" -h my.server.com -p 3269
-w "mypass" -x "(cn=test)"
ldap_create
ldap_url_parse_ext(ldap://my.server.com:3269)
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 my.server.com:3269
ldap_new_socket: 3
ldap_prepare_socket: 3
ldap_connect_to_host: Trying 10.199.46.70:3269
ldap_connect_timeout: fd: 3 tm: -1 async: 0
ldap_open_defconn: successful
ldap_send_server_request
ber_scanf fmt ({it) ber:
ber_scanf fmt ({) ber:
ber_flush: 31 bytes to sd 3
ldap_result ld 0x95ff590 msgid 1
wait4msg ld 0x95ff590 msgid 1 (infinite timeout)
wait4msg continue ld 0x95ff590 msgid 1 all 1
** ld 0x95ff590 Connections:
* host: my.server.com port: 3269 (default)
refcnt: 2 status: Connected
last used: Mon Feb 27 10:59:43 2012
** ld 0x95ff590 Outstanding Requests:
* msgid 1, origid 1, status InProgress
outstanding referrals 0, parent count 0
** ld 0x95ff590 Response Queue:
Empty
ldap_chkResponseList ld 0x95ff590 msgid 1 all 1
ldap_chkResponseList returns ld 0x95ff590 NULL
ldap_int_select
read1msg: ld 0x95ff590 msgid 1 all 1
ber_get_next
ldap_perror
ldap_start_tls: Can't contact LDAP server (-1)
Run Code Online (Sandbox Code Playgroud)
错误消息未提供有关错误的提示.相比之下,简单的绑定和搜索在端口389上没有任何问题.
任何提示?
PS这是我的ldap.conf:
TLS_REQCERT demand
TLS_CACERT ./cacert.pem
Run Code Online (Sandbox Code Playgroud)
我甚至试图改变TLS_REQCERT
到never
,但它仍然无法正常工作.:-(
ixe*_*013 60
首先,替代-h my.server.com -p 3269
与-H ldaps://my.server.com:3269
被@dearlbry的建议.
然后,在/etc/openldap/ldap.conf
(或/etc/ldap/ldap.conf
在我的Ubuntu 13.04上),通过添加以下内容禁用证书验证:
HOST my.server.com
PORT 3269
TLS_REQCERT ALLOW
Run Code Online (Sandbox Code Playgroud)
ldaprc
如果您不想影响整个系统,也可以在当前目录中创建具有相同内容的文件.
这将启用SSL上的ldapsearch,但不进行验证.按照以下步骤将证书验证添加到组合中.
归档时间: |
|
查看次数: |
87780 次 |
最近记录: |