【问题标题】:Setup Secure LDAP over SSL/TLS (LDAPS) for PostgreSQL为 PostgreSQL 设置基于 SSL/TLS (LDAPS) 的安全 LDAP
【发布时间】:2022-01-07 06:58:35
【问题描述】:

在尝试多种方法为 PostgreSQL 实现 LDAPS 时运气不佳。

pg_hba.conf

hostssl all +test_ldap 0.0.0.0/0 ldap ldapserver=dc2.ad.foobar.com ldapport=636 ldapscheme=ldaps ldaptls=0 ldapbinddn="CN=ldap,OU=Helpers,OU=Foobar,DC=ad,DC=foobar,DC=com" ldapbindpasswd=*** ldapsearchattribute=mail ldapbasedn="OU=Users,OU=Foobar,DC=ad,DC=foobar,DC=com"

research,我发现下面的参数要改了。

postgresql.conf

ssl = on
ssl_cert_file = 'server.crt'
ssl_key_file = 'server.key'

问题是我如何从我已经拥有的 .pem 证书(由 LDAP 团队共享)中获得 .crt.key。除了这些之外,还需要做些什么才能使其与 LD​​APS (SSL/TLS) 一起使用。

【问题讨论】:

    标签: postgresql ssl ldap


    【解决方案1】:

    解决方法是使用ldaptls=1

    the documentation:

    ldaptls

    设置为 1 以使 PostgreSQL 和 LDAP 服务器之间的连接使用 TLS 加密。这使用每个RFC 4513StartTLS 操作。另请参阅ldapscheme 选项以了解替代方案。

    我不知道如果您将两个选项设置为相互矛盾的值会发生什么,但这很可能是问题所在。

    【讨论】:

    • 虽然这段代码 sn-p 可以解决问题,但它没有解释为什么或如何回答这个问题。请include an explanation for your code,因为这确实有助于提高您的帖子质量。请记住,您是在为将来的读者回答问题,而这些人可能不知道您提出代码建议的原因。
    • @LucaKiebel 我已经扩展了答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-05
    • 1970-01-01
    • 1970-01-01
    • 2011-12-22
    相关资源
    最近更新 更多