AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-377693

Reapbooster's questions

Martin Hope
Reapbooster
Asked: 2016-10-15 17:46:49 +0800 CST

LDAPS 握手失败 errno 21 是目录 - 遇到文件结尾

  • 1

我已经设置了一个CentOS 7 openLDAP passthrough 身份验证服务器。

它将通过 LDAP 在 Microsoft Active Directory 上托管的数据库上对用户进行身份验证。

如果我使用 LDAP://,我可以获得成功的查询响应

但是,LDAPS:// 会给出证书握手错误。

我正在使用从 GoDaddy 购买的 PFX 格式的证书。

我找到了一些可能的解决方案,但到目前为止没有任何效果。

我努力了:

  1. 禁用 SELinux 进行测试
  2. 将 PFX 证书转换为 PEM 和 DER
  3. 使用此处解释的 certutil 来制作 MozNSS DB: http ://www.openldap.org/faq/data/cache/1514.html

    pk12util -d /path/to/certdb -i /path/to/file.p12

我找到了这个页面https://stackoverflow.com/questions/13732826/convert-pem-to-crt-and-key 但我不知道使用什么命令来获取 openLDAP 的正确格式证书。

我试过这些:

openssl x509 -outform der -in certificate.pem -out certificate.der
openssl x509 -outform der -in certificate.pem -out certificate.crt

当我运行 ldapsearch 时:

ldapsearch -H ldaps://192.168.1.69 -b "OU=Administration,DC=domain,DC=com" -v -LLL -D "CN=ServiceLDAP,OU=Administration,DC=domain,DC=com" "(samaccountname=someuser)" -w secretpass -d1

这些是我得到的错误:

ldap_url_parse_ext(ldaps://192.168.1.32)
ldap_initialize( ldaps://192.168.1.32:636/??base )
ldap_create
ldap_url_parse_ext(ldaps://192.168.1.32:636/??base)
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP 192.168.1.32:636
ldap_new_socket: 4
ldap_prepare_socket: 4
ldap_connect_to_host: Trying 192.168.1.32:636
ldap_pvt_connect: fd: 4 tm: -1 async: 0
attempting to connect:
connect success
TLS: certdb config: configDir='/etc/openldap/certs' tokenDescription='ldap(0)' certPrefix='' keyPrefix='' flags=readOnly
TLS: using moznss security dir /etc/openldap/certs prefix .
TLS: error: tlsm_PR_Recv returned 0 - error 21:Is a directory
TLS: error: connect - force handshake failure: errno 21 - moznss error -5938
TLS: can't connect: TLS error -5938:Encountered end of file.
ldap_err2string
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
centos openldap tls
  • 1 个回答
  • 1842 Views
Martin Hope
Reapbooster
Asked: 2016-09-27 11:00:46 +0800 CST

OpenLDAP 作为 Active Directory 的代理不与来自 slapd.conf 的 bindDN 绑定

  • 0

背景资料:

CentOS 7 3.10.0-327.18.2.el7.x86_64

此服务器将用作 Active Directory 的代理。

目前似乎ldapsearch不关心 /etc/openldap/slapd.conf 并且不会绑定,除非我直接使用 -D 和 -w 传递 bindDN 和密码。

我重新安装了 OpenLDAP 服务器

使用以下内容编辑 slapd.conf:

### Schema includes ###########################################################
include                 /etc/openldap/schema/core.schema
include                 /etc/openldap/schema/cosine.schema
include                 /etc/openldap/schema/inetorgperson.schema
include                 /etc/openldap/schema/misc.schema
include                 /etc/openldap/schema/nis.schema

## Module paths ##############################################################
modulepath              /usr/lib64/openldap/
moduleload              back_ldap
moduleload              rwm

## Support both LDAPv2 and LDAPv3
allow           bind_v2

# Main settings ###############################################################
pidfile                 /var/run/openldap/slapd.pid
argsfile                /var/run/openldap/slapd.args

### Database definition (Proxy to AD) #########################################
database                ldap
readonly                yes
protocol-version        3
rebind-as-user          yes
uri                     "ldap://10.0.0.90:389"
suffix                  "DC=secretdomain,DC=com"
idassert-bind           bindmethod=simple
                        binddn="CN=MropenLDAP,OU=Administration,DC=secretdomain,DC=com"
                        credentials=topsecretpass
                        mode=none
idassert-authzFrom      "*"
overlay                 rwm
rwm-map                 attribute       uid     sAMAccountName
rwm-map                 attribute       mail    proxyAddresses

### Logging ###################################################################
logfile                 /var/log/slapd/slapd.log
loglevel                1

冉:slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d/

确保所有权和权限正确,然后重新启动 slapd。

以下不起作用:

ldapsearch -H ldap://10.0.0.90 -x -b "OU=Administration,DC=secretdomain,DC=com" -v -LLL "(samaccountname=someusername)"

ldapsearch -H ldap://10.0.0.90 -x -b "OU=Administration,DC=secretdomain,DC=com" -v -LLL

它给了我这个错误:

ldap_initialize( ldap://10.0.0.90:389/??base )
filter: (objectclass=*)
requesting: All userApplication attributes
Operations error (1)
Additional information: 000004DC: LdapErr: DSID-0C0906E8, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v1db1

但是,当我直接传递绑定帐户 DN 时,它可以工作。我从 /etc/openldap/slapd.conf 文件中检查了这两条信息是否相同:

ldapsearch -H ldap://10.0.0.90 -x -b "OU=Administration,DC=secretdomain,DC=com" -v -LLL -D "CN=MropenLDAP,OU=Administration,DC=secretdomain,DC=com" "(samaccountname=someusername)" -w topsecretpass
active-directory proxy ldap openldap centos7
  • 1 个回答
  • 4291 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve