带有SSL自签名证书的PostgreSQL LDAP认证

我正在尝试为在RHEL 7.5上运行的PostgreSQL 12实例上的用户设置LDAP身份验证。

我所做的:

  • 将所有必要的内容放入/etc/pki/ca-trust/source/anchors中 证书从LDAP服务器之一开始到 内部根证书颁发机构(这是自签名证书颁发机构)-可能只需要根证书(更新:仅根ca证书就足够了)
  • 运行update-ca-certs extract命令将更改提交到系统
  • 使用openssl s_client -showcerts -connect myldapshost:636结尾处返回的Verify return code: 0 (ok)(ldaps)验证了信任链的正确性
  • 为我要针对LDAP进行身份验证的用户配置了pg_hba.conf条目:

    host all myuser samenet ldap ldapscheme=ldaps ldaptls=0 ldapserver=myldapshost ldapport=636 ldapbasedn="mybasedn" ldapbinddn="<mybinddn>" ldapbindpasswd=secret

    • 告诉服务器使用pg_ctl reload重新加载配置

当我尝试使用myuser身份验证为psql -h mypostgreshost mydb时,出现此错误:

psql: error: could not connect to server: FATAL:  LDAP authentication failed for user "myuser"
FATAL:  LDAP authentication failed for user "myuser"

我看PostgreSQL日志:

LDAP diagnostics: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed (self signed certificate in certificate chain)

问题是:如何告诉PostgreSQL信任它找到的自签名证书? 谢谢

lvcha108 回答:带有SSL自签名证书的PostgreSQL LDAP认证

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3145319.html

大家都在问