CF8 SSL 连接到 Postgres 失败

发布于 2024-10-26 03:22:20 字数 751 浏览 7 评论 0 原文

我正在尝试从 ColdFusion 8 Enterprise 客户端到 Redhat 5 Postgres 服务器的 SSL 连接。另一方设置了 Postgres 并向我发送了证书。

  1. 我成功将 root.crt 导入 E:\JRun4\jre\lib\security\cacerts 并重新启动服务。
  2. Postgres pg_hba.conf 文件具有客户端 IP,并且无需 SSL 即可正常连接
  3. Postgresql.conf 具有 ssl=on
  4. 服务器端证书是根据 http://www.postgresql.org/docs/8.2/static/ssl-tcp.html 并推测已完成正确的。

启用 SSL 后,我收到 org.postgresql.util.PSQLException: The connection attempts failed.,它从我所做的搜索中产生了很少的有用信息。

JDBC URL:jdbc:postgresql://xxxx/main?ssl=true
类:org.postgresql.Driver

可以做什么来查看/测试错误源是否在我端或服务器端?

I'm attempting an SSL connection from a ColdFusion 8 Enterprise client to a Redhat 5 Postgres server. Another party set up Postgres and sent me the certificates.

  1. I imported root.crt into E:\JRun4\jre\lib\security\cacerts successfully and restarted the service.
  2. The Postgres pg_hba.conf file has the client IP, and connects fine without SSL
  3. Postgresql.conf has ssl=on
  4. The server-side certs were created according to http://www.postgresql.org/docs/8.2/static/ssl-tcp.html and presumingly done correct.

With SSL enabled, I get org.postgresql.util.PSQLException: The connection attempt failed. which produces little helpful information from the searches I've done.

JDBC URL: jdbc:postgresql://x.x.x.x/main?ssl=true
Class: org.postgresql.Driver

What can be done to see/test if the error source is on my end or the server end?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

绾颜 2024-11-02 03:22:21

在对此类问题进行故障排除时,首先要考虑的明显问题是:

  1. 您可以使用 psql 启用 SSL 进行连接吗?

  2. postgresql 日志中有什么有趣的内容吗?

  3. 如果这不起作用,有没有办法可以根据根 ca 的签名测试证书?

  4. 如果失败,我唯一能想到的就是跟踪客户端并查看 SSL 库中失败的确切位置。

Obvious questions to start with in troubleshooting something like this are:

  1. Can you connect with SSL enabled using psql?

  2. Is there anything of interest in the postgresql logs?

  3. If that doesn't work, is there a way you can test the certificate against the root ca's signature?

  4. If that fails, the only thing I can think of is tracing the client side and seeing exactly where in the SSL libraries it fails.

も星光 2024-11-02 03:22:21

对于证书问题,请将 &sslfactory=org.postgresql.ssl.NonValidatingFactory 添加到您的 jdbc url。请参阅 https://jdbc.postgresql.org/documentation/91/ssl-client .html 了解更多信息。

For certificate problems add &sslfactory=org.postgresql.ssl.NonValidatingFactory to your jdbc url. See https://jdbc.postgresql.org/documentation/91/ssl-client.html for more information.

南烟 2024-11-02 03:22:21

我找到了解决这个问题的笔记。请注意,驱动器和文件夹路径可能与您的设置不同。

  1. 将 server.crt.der 复制到目标服务器
  2. 在目标服务器中打开命令窗口并转到 E:\Jrun4\jre\bin\
  3. 输入以下命令: keytool -importcert -alias postgres -keystore e:\jrun4 \jre\lib\security\cacerts -file c:\location\of\server.crt -storepass changeit
  4. 它会提示你是否应该信任这个证书;回答是
  5. 要验证是否已成功安装,请键入:keytool -list -alias postgres -keystore e:\jrun4\jre\lib\security\cacerts -storepass changeit。如果成功,您将看到该别名返回的单个列表,否则会显示未找到
  6. 证书存储后,您可以从服务器中删除实际的证书文件
  7. 在客户端计算机上重新启动 ColdFusion 服务

I found the notes I took for solving this. Note that the drive and folder paths may be different for your setup.

  1. Copy server.crt.der your destination server
  2. Open a command window in your destination server and go to E:\Jrun4\jre\bin\
  3. Type in the following command: keytool -importcert -alias postgres -keystore e:\jrun4\jre\lib\security\cacerts -file c:\location\of\server.crt -storepass changeit
  4. It will prompt you whether you should trust this certificate; answer yes
  5. To verify it successfully installed, type: keytool -list -alias postgres -keystore e:\jrun4\jre\lib\security\cacerts -storepass changeit. If successful you'll see a single listing return by that alias, otherwise it will say none found
  6. After the certificate has been stored you may delete the actual certificate file from the server
  7. Restart ColdFusion services on the client machine
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文