java - LDAP over TLS 与 Spring 框架
问题描述
我们开发了一个 Java 应用程序来使用 Spring 集成 LDAP 用户。它在应用程序连接 LDAP 上的 LDAP 服务器时起作用(ldap://openldap:389)。通过 TLS(ldaps://openldap:636)连接 LDAP 服务器时遇到问题。
环境:
已安装 TurnKey Open Ldap 服务器 VM
将生成一个新的自签名证书。它用于 java 应用程序和 LDAP 服务器
例外:
Caused by: org.springframework.ldap.CommunicationException: simple bind failed: openldap:636; nested exception is javax.naming.CommunicationException: simple bind failed: openldap:636 [Root exception is javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching openldap found]
在 java 应用程序中使用 Turnkey Open Ldap VM 中捆绑的内置证书时引发以下异常
org.springframework.ldap.CommunicationException: simple bind failed: openldap:636; nested exception is javax.naming.CommunicationException: simple bind failed: openldap:636 [Root exception is java.net.SocketException: Connection or outbound has closed]
解决方案
这是根证书问题。我将错误的 CA 证书导入 cacerts。根本原因是我们在 TurnKey open ldap 中查看了错误的证书配置位置。在/etc/ldap/tls中找到的证书,但我们看错了 /etc/ssl/private
它在将 ca_cert.pem 从 /etc/ldap/tls 导入客户端的 cacerts 后工作。
推荐阅读
- php - 在 Urban Airship 中列出活动日志的 API
- python - 从 db 中获取数据到列表中,用括号 [row1],[row2] python
- ansible - Ansible ssh 连接失败并显示“无法登录:连接被拒绝”
- python - 如何在 python 中为多个模块实现日志记录
- java - Spring Boot @Scheduled fixedDelay 在一段时间后停止工作
- java - 编译基于 Cucumber JUnit 的运行器类
- excel - VBA 将超链接的一部分替换到同一工作簿中的另一个工作表
- javascript - 如何暂停当前正在使用 getusermedia 录制的录制文件?
- azure - 如何正确地将 Azure CDN 端点映射到 blob 存储容器中的 Angular 7 项目
- jquery - 数据表在第二页不起作用