大网数据广告活动
服务器运维问答

How to use ldapsearch with SSL on different port (-p does not work)?

· 52CE 我爱测

I have an OpenLDAP server running in a test environment with a firewall on the LAN forwarding port 8636 back to slapd listening on 636 (for an older application which does not support START_TLS). To test things, I started on the …

问题原文

原帖链接 · Server Fault · CC BY-SA 3.0

I have an OpenLDAP server running in a test environment with a firewall on the LAN forwarding port 8636 back to slapd listening on 636 (for an older application which does not support START_TLS).

To test things, I started on the LAN by specifying -p 8636 in the comamand line. This failed for some reason, so I went ahead and tried the same command on the LDAP server itself. I get the same error:

ldap1# ldapsearch -x -H ldaps://ldap1 -p 8636
ldapsearch: -H incompatible with -p

Huh? Why is this a problem? If I don't specify a port number, then it all works OK:

ldap1# ldapsearch -x -H ldaps://ldap1
# extended LDIF
#
# LDAPv3
...

Is there any other way to tell ldapsearch to use SSL on a different port or have I missed something in the syntax?

UPDATE per answer

ldap1# ldapsearch -x -H ldaps://ldap1:636
# extended LDIF
#
# LDAPv3

...

已采纳解答

原帖链接 · HBruijn · CC BY-SA 3.0

ldapsearch: -H incompatible with -p
Huh? Why is this a problem?

You either use the deprecated -h and -p to respectively set the hostname and non-default port number,
or you use -H with a properly RFC 2255 specified URL <scheme>://<hostname>[:portnumber] to set a non-standard port e.g. ldaps://ldap1:8636

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-03-30)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。